SearchUsers - Amazon Rekognition

SearchUsers

Searches for UserIDs within a collection based on a FaceId or UserId. This API can be used to find the closest UserID (with a highest similarity) to associate a face. The request must be provided with either FaceId or UserId. The operation returns an array of UserID that match the FaceId or UserId, ordered by similarity score with the highest similarity first.

Request Syntax

{ "CollectionId": "string", "FaceId": "string", "MaxUsers": number, "UserId": "string", "UserMatchThreshold": number }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

CollectionId

The ID of an existing collection containing the UserID, used with a UserId or FaceId. If a FaceId is provided, UserId isn’t required to be present in the Collection.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [a-zA-Z0-9_.\-]+

Required: Yes

FaceId

ID for the existing face.

Type: String

Pattern: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

Required: No

MaxUsers

Maximum number of identities to return.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 500.

Required: No

UserId

ID for the existing User.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_.\-:]+

Required: No

UserMatchThreshold

Optional value that specifies the minimum confidence in the matched UserID to return. Default value of 80.

Type: Float

Valid Range: Minimum value of 0. Maximum value of 100.

Required: No

Response Syntax

{ "FaceModelVersion": "string", "SearchedFace": { "FaceId": "string" }, "SearchedUser": { "UserId": "string" }, "UserMatches": [ { "Similarity": number, "User": { "UserId": "string", "UserStatus": "string" } } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FaceModelVersion

Version number of the face detection model associated with the input CollectionId.

Type: String

SearchedFace

Contains the ID of a face that was used to search for matches in a collection.

Type: SearchedFace object

SearchedUser

Contains the ID of the UserID that was used to search for matches in a collection.

Type: SearchedUser object

UserMatches

An array of UserMatch objects that matched the input face along with the confidence in the match. Array will be empty if there are no matches.

Type: Array of UserMatch objects

Array Members: Maximum number of 500 items.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You are not authorized to perform the action.

HTTP Status Code: 400

InternalServerError

Amazon Rekognition experienced a service issue. Try your call again.

HTTP Status Code: 500

InvalidParameterException

Input parameter violated a constraint. Validate your parameter before calling the API operation again.

HTTP Status Code: 400

ProvisionedThroughputExceededException

The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

HTTP Status Code: 400

ResourceNotFoundException

The resource specified in the request cannot be found.

HTTP Status Code: 400

ThrottlingException

Amazon Rekognition is temporarily unable to process the request. Try your call again.

HTTP Status Code: 500

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: