Skip to main content

Face Match API - Global

API Description

Objective

The Face Match API determines whether two facial images belong to the same person.

info

The Face Match API verifies whether two images belong to the same person. It neither checks the completeness, quality of the face passed as input, nor does it validate whether the inputs are selfies or ID images. The model simply compares the two images and returns whether it is a match or not.

For proper input validation and reliable results, it is recommended to invoke the Selfie Validation module before the Face Match step. Please refer to our Selfie Validation API documentation for more details.

InputOutput
Two different image sources with the individual's faceA "yes" or "no" for the face match evaluation across the two image sources

API URL

https://<regionCode>.idv.hyperverge.co/v1/matchFace

API Endpoint

matchFace

regionCode Details

The API URL accepts any of the following region code values against the regionCode placeholder. For example, "https://ind.idv.hyperverge.co/v1/matchFace"

RegionregionCode Value
Indiaind
USAusa
Africazaf
Europeirl
Singaporesgp

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionAccepted Values
content-type Mandatory This parameter defines the media type for the request payload.multipart/form-data
appId Mandatory Application ID shared by HyperVerge N/A. This is a unique value.
appKey MandatoryApplication Key shared by HyperVerge N/A. This is a unique value.
transactionIdMandatoryUnique ID for the customer journey. N/A. Any defined unique value mapped to a transaction in your business ecosystem.

Inputs

Type of Image Input

The API supports both image files and image URLs as input.

The following are the different variations of the request body based on the type of input images.

  • selfie - A selfie image in JPEG, PNG or TIFF format.
  • id - An image of the ID card in JPEG, PNG or TIFF format.

This match type compares a selfie against a complete ID card image.

Requests

The following is a sample request for matching a selfie with an identity document's image:

curl --location --request POST 'https://<regionCode>.idv.hyperverge.co/v1/matchFace' \
--header 'appId:<Enter_the_HyperVerge_appId>' \
--header 'appKey:<Enter_the_HyperVerge_appKey>' \
--header 'transactionId:<Enter_the_HyperVerge_transactionID>' \
--header 'content-type: multipart/form-data' \
--form 'selfie=@abc.png' \
--form 'id=@xyz.png'

Optional Configurations

The following are the optional parameters configurable for the API.

ParameterPositionValueDefaultDescription
preferences.returnScoreBody"yes"/"no""no" This will provide the match-score in the output when set to "yes".

General Image Input Guidelines

  • The API supports JPEG, PNG and TIFF images and PDFs inputs.
  • Ensure that the document in the image is legible. This is a rule of thumb for our OCR servers to accurately extract any text from an image.
  • Reduce the size of the image as much as possible to optimise the reponse time while also ensuring its legibility criteria as mentioned earlier. Larger image sizes lead to higher uploading and processing time.
  • You can keep the width of the ID card image at least 800 pixels and the JPEG compression quality factor above 80%.
  • For our DL server to extract text from the document, the aspect ratio of the input image should be the same as the aspect ratio of the original document. Hence utmost care should be taken while resizing the image to maintain the aspect ratio

Success Response

A success response from the API reflects the success status with a status code of 200 and a result object containing the response data with the following field-value pairs.

{
"status": "success",
"statusCode": "200",
"result":
{
"details":
{
"match": {
"value": "yes"/"no",
"score": <face_match_score> // optional,
"confidence": "high"/"low",
},
},
"summary" : {
"action" : "pass/fail/manualReview",
"details : [],
}
},

"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>",
},
}

Error Responses

{
"status" : "failure",
"statusCode" : "400",
"error" : "Face not detected in ID image"
}
{
"status": "failure",
"statusCode": 400,
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"error": "Invalid value passed to selfieFaceString",
"summary": {
"action": "fail",
"details": [
{
"code": "111",
"message": "Bad Request. Please refer the documentation"
}
]
}
}
}

Error Response Details

A failure or error response from the module contains a failure status, with a relevant status code and error message. The following table lists all error responses:

Status CodeError MessageError Description
400Face not detected in Selfie imageThe AI model failed to detect the face in the selfie.
400Face not detected in ID imageThe AI model failed to detect the face in the image of the identification document.
400Missing / Wrong combination of parametersThe request contains an invalid combination of parameters. Please refer to the valid parameter combinations in the documentation.
400image size cannot be greater than 6MBThe maximum size of input image is 6MB which you have exceeded.
400Invalid value passed to idFaceStringThe provided idFaceString parameter contains an invalid or malformed value.
400Invalid value passed to selfieFaceStringThe provided selfieFaceString parameter contains an invalid or malformed value.
400Unsupported file typeThe request contains an unsupported file type. Please use one of the following file types: ".jpeg", ".png", ".tiff" or ".pdf".
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
423Multiple faces detected. Click Selfie/ID againThe AI model detected multiple faces in the input image. Please provide an image with only one face.
429Requests rate limit exceededThe number of transactions per minute has crossed the limit set for your credentials.
500/501Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution.
503DEPENDENCY SERVER BUSYThere is an overload on HyperVerge's server. Please try again after some time.
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: