Face Verification
On this page
The face verification endpoint is essential for confirming an individual’s presence by matching their live capture against a pre-registered or document-linked photo. This process is integral for verifying identity authenticity, safeguarding against impersonation and ensuring the person engaging with the service is who they claim to be.
API call
To perform a face verification check.
This API currently supports basic authentication. All endpoints require an Authentication header in the following form:
Authorization: 'Basic ' + Base64.encode(username + ':' + password)
Send a HTTP POST request to:
/api/v1/face/verify
The following parameters are used for requests and responses:
Parameter | Direction | Description |
---|---|---|
sessionId | request | unique, short-lived code to be generated by the client to track specific sessions. |
probe/imageBase64 | request | live or current photo captured during the verification process. Base64 format. |
reference/imageBase64 | request | previously stored or found on an official document against which the probe image is compared. Base64 format. |
sessionId | response | unique, short-lived code to be generated by the client to track specific sessions. Same as in request |
score | response | score of the verifiation, [0..100]. Higher score means higher probability level, default threshold is set to 27. |
hasError | response | boolean parameter - true - verification process ended up with some error; false - no errors |
error | response | error message in case of hasError set to true, informing about type of error, for instance MISSING_PROBE_IMAGE |
Request:
{
"sessionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"probe": {
"imageBase64": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr
...
+SSyDCtmmrGoXzc8AcrURjKEjNOK6DII0ZyJFVgepUdKv26X0WVhuGcMPlBP3RVeFluDiNdvY8VbEUnO2UjaOTnrXoUZc8dTOdSUZEotL7A/eD/AL6oqVLJCoJmk6f3qKv2Rz+0if/Z"
},
"reference": {
"imageBase64": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr
...
+SSyDCtmmrGoXzc8AcrURjKEjNOK6DII0ZyJFVgepUdKv26X0WVhuGcMPlBP3RVeFluDiNdvY8VbEUnO2UjaOTnrXoUZc8dTOdSUZEotL7A/eDDII0ZyJFVgepUdKv26X0WVhuGcMd4"
}
}
Response - face verification passed
{
"sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
"score": 99,
"hasError": false
}
Response - face verification not passed:
{
"sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
"score": 23,
"hasError": false
}
Response - error
{
"sessionId": "bbbf9002-c3a2-4308-b103-d80b9f5a2b84",
"hasError": true,
"error": "MISSING_PROBE_IMAGE"
}
List of errors
Error | Meaning | Description |
---|---|---|
MISSING_PROBE_IMAGE | Image is missing | Image is missing, corrupted image, not a Base64 format image. |
MISSING_REFERENCE_IMAGE | Image is missing | Image is missing, corrupted image, not a Base64 format image. |
PROBE_FACE_NOT_FOUND | Failed to detect face | Face detector can’t find face on image. Face detection has probabilistic nature and may have errors. It also has some sensitivity level and very small faces may be ignored. |
REFERENCE_FACE_NOT_FOUND | Failed to detect face | Face detector can’t find face on image. Face detection has probabilistic nature and may have errors. It also has some sensitivity level and very small faces may be ignored. |
INTERNAL_ERROR | Internal error | Internal error, contact us |