Skip to content

Verify Face Liveness ​

Determines whether a portrait image shows a live person in front of the camera rather than a printed photo, a screen replay or another presentation attack.

Endpoint ​

http
POST /v1/verify_face_liveness_sync
Content-Type: application/json
json
{
  "images": [
    {
      "id": "2dc863d6-1f68-4c82-8380-dd34e4ed7da0",
      "base64": "",
      "label": "portrait",
      "metadata": "{}"
    }
  ]
}

Parameters:

ParamTypeRequiredDefaultDescription
imagesImageData[]Yes—One or more portrait images captured during the liveness step.

ImageData ​

ParamTypeRequiredDefaultDescription
idstringNo—ID of the image returned by Upload Image.
base64stringNo—Base64-encoded text of the image data.
labelstringNo—Label of the image, as described in Usage Recommendations.
metadatastring_jsonNo—Key/value JSON string. Example: {"id":"<ID>","type":1}

Sample Request ​

bash
curl --location '<BASE_URL>/v1/verify_face_liveness_sync' \
  --header 'Authorization: ATV <ACCESS_ID>:<SIGNATURE>' \
  --header 'X-TV-Timestamp: <TIMESTAMP>' \
  --header 'Content-Type: application/json' \
  --data '{
    "images": [
      {
        "id": "ba056dc8-e702-4292-90b5-5c549c4db956",
        "base64": "",
        "label": "portrait",
        "metadata": "{}"
      }
    ]
  }'

Response ​

json
{
  "success": true,
  "code": 0,
  "message": "success",
  "data": {
    "request_id": "88b35583-76e0-4380-8a0b-a2d86436b6a5",
    "status": "success",
    "is_live": true,
    "score": 1,
    "images": [
      {
        "id": "ba056dc8-e702-4292-90b5-5c549c4db956",
        "is_live": true,
        "score": 0.9998822
      }
    ],
    "main_image_id": ""
  },
  "errors": []
}
FieldTypeDescription
data.request_idstringRequest ID; quote it to CAKE Support when checking logs.
data.statusstringsuccess or failure.
data.is_liveboolOverall liveness result across all submitted images.
data.scorefloatOverall liveness confidence, range 0–1.
data.imagesLivenessResult[]Per-image liveness result.
data.main_image_idstringID of the image the overall verdict was drawn from, when one was selected.

LivenessResult ​

FieldTypeDescription
idstringID of the image.
is_liveboolWhether this image shows a live person.
scorefloatLiveness confidence for this image, range 0–1.

WARNING

Evaluate liveness on the server from the API response, never from a client-reported result. A compromised mobile client can claim is_live: true; only your backend reading a signature-verified response can be trusted.

Errors ​

CodeMessage
2001010Access ID not found.
401100You are not authorized to perform the action.
4001000Input parameter violates a constraint.
4001001The X-TV-Timestamp header is expired, need a newer one.
5001000Some unexpected error occurs while processing the request.
CodeDescription
access_denied_exceptionYou are not authorized to perform the action.
invalid_parameter_exceptionInput parameter violates a constraint.
request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
image_not_found_exceptionThe image ID is not found in DB.
rate_limit_exceptionThe number of requests exceeded your throughput limit.
internal_server_errorSome unexpected error occurs while processing the request.

Next Steps ​

Developers