Skip to main content
Version: 3.0.0

Liveness

POST

  https://api.apptenticate.com/api/v3/biometrics/liveness/


Authentication

Use your JWT obtained from the authentication: /docs/auth/token process to make requests to this endpoint.

The response will be 401 unauthorized if the JWT is expired. In this case, you will need to obtain a new JWT.


This endpoint is the entry point for all requests to the Liveness service, which allows you to process selfies and classify them as spoofing or real.

Spoofing: Attack on a facial biometric system that uses an image to deceive the authentication process.

Request data

The following parameters can be sent in the body of a request to this endpoint:

NameTypeDescriptionRequerido
selfiefileImage of the person's selfie. The endpoint supports any valid image format (PNG, JPG, JPEG, etc.).true
return_idbooleanBoolean indicating whether you want to get the transaction ID.false
devicestringDevice from which the liveness test is being performed. DESKTOP, IOS or ANDROID.false
detailsbooleanBoolean indicating whether you want to get liveness test details.false

Request parameters

If you choose to display the details along with the response, you will get the following data:

Response format: JSON
data: {
"api_response": {
"score": 2.656599,
"quality": 0.8511556,
"liveness": 0.9344166
},
}

score: The higher the score, the higher the liveness of the image. The value is not limited and can be used for calibration purposes.

quality: Defines how "appropriate" the image is for liveness checking. The value can be in the range [0,1]. Images with quality values below 0.5 will be automatically rejected by the service.

liveness: Defines how "real" the image is or if it is spoofing. The value can be in the range [0,1]. Images with liveness values below 0.5 will be automatically rejected by the service.

Example of request

Request
curl --location 'https://api.apptenticate.com/api/v3/biometrics/liveness/' \
--form 'selfie="<selfie>"' \
--form 'return_id="<return_id>"' \
--form 'device="<device>"' \
--form 'details="<details>"'

Response example

This will be the format of the response obtained when sending all the parameters:

Response format: JSON
data: {
"valid": true,
"api_response": {
"score": 2.656599,
"quality": 0.8511556,
"liveness": 0.9344166
},
"id": 1111
}

When you stop sending the return_id parameter in the request, the response format will be as follows:

Response format: JSON
data: {
"valid": true,
"api_response": {
"score": 2.656599,
"quality": 0.8511556,
"liveness": 0.9344166
}
}

If the details parameter is also omitted in the request, the response format will be as follows:

Response format: JSON
data: {
"valid": true
}

If the service detects any problem in the sent image, the response format will be as follows:

Response format: JSON
data: {
"valid": false,
"message": "Rostro muy reducido en pixeles",
"error_code": 706
}

Rejection codes

If the request is not successful, a rejection code will be sent in the response. Possible rejection codes are:

CodeMessage
700Face to close.
701Face to close to borders.
702Incomplete face.
703Obstructed face.
704Face not detected.
705Too many faces.
706Face reduced in pixels
707Incorrect angle of the face.
708Error reading image.
709Error processing image.
710Error predicting face borders.
711Internal liveness error
712Unkown error.
713Livenes image quality not acceptable.
714Minimum image conditions for liveness not met.
715Minimum score for liveness not met.