Liveness Detection
Credits: 1 per call.
Determines whether a selfie shows a real, live person in front of the camera (isLive: true) or a spoofing attempt (isLive: false).
Returns:
isLive: the decision.livenessScore(0–100) is the fused output of the anti-spoofing models; the decision threshold is 62.confidence: how far the score landed from the threshold —HIGH(25 points or more),MEDIUM(10 or more) orLOW.selfieAnalysis: quality and attribute labels of the evaluated face (image quality, orientation, eyes open, glasses, face covered, actionableissues[]). Same object asmatchFaces, so both endpoints share one integration.
Multiple people in frame. By default a selfie with another person present returns MULTIPLE_FACES_DETECTED. Send allowMultipleFaces: true to evaluate the largest face in the image instead (the person holding the phone); selfieAnalysis describes that same face. Only faces of at least 25% of the main face’s area count as another person — people in the background do not.
Decision rule. Accept only type: SUCCESS with isLive: true. NO_FACE_DETECTED, MULTIPLE_FACES_DETECTED and IMAGE_UNREADABLE also return isLive: false, but nothing was evaluated — data always carries the full object so you can read data.isLive without branching on type. Detecting a spoofing attempt is a SUCCESS: the service did its job.
Images. JPG or PNG. The image is downscaled internally; no client-side resizing is needed. For best results send at least 1600 px on the longest side at JPEG quality 80 or better. The result is a liveness decision only; it does not verify identity — pair it with matchFaces for that.
INVALID_REQUEST returns every problem found in errors[] at once (cumulative), so you can fix them in one pass.
selfieAnalysis reference. Describes the evaluated face. Labels are derived from the face-analysis provider as follows:
| Field | Values | Rule |
|---|---|---|
imageQuality | excellent · good · poor | excellent: brightness ≥ 75 and sharpness ≥ 75 · good: both ≥ 50 · poor: otherwise. In practice poor almost always means a dark image, not an out-of-focus one. |
detectionConfidence | high · medium · low | high ≥ 95 · medium ≥ 80 · low below 80. |
orientation | sideways · looking_left · looking_right · looking_up · looking_down · tilted · front | Evaluated in that order, first match wins: sideways abs(yaw) ≥ 25° · looking_left yaw ≥ 10° · looking_right yaw ≤ −10° · looking_up pitch ≥ 20° · looking_down pitch ≤ −20° · tilted abs(roll) ≥ 15° · otherwise front. |
eyesOpen, mouthOpen, wearingGlasses, wearingSunglasses, faceCovered | true · false · null | null when the attribute could not be determined. mouthOpen is informational and never produces an issue. |
issues[] lists every condition detected on the face. All possible values:
| Value | Condition |
|---|---|
poor_image_quality | imageQuality is poor |
not_facing_camera | orientation is not front |
eyes_closed | eyesOpen is false |
face_covered | faceCovered is true — mask, scarf, hand, hair over the eyes, face partly out of frame |
wearing_glasses | wearingGlasses is true — informational, not a capture problem |
wearing_sunglasses | wearingSunglasses is true |
low_detection_confidence | detectionConfidence is low |
In production about 4 in 10 legitimate selfies carry at least one issue — treat issues[] as retry hints, not as rejection criteria.
Autorizaciones
Cuerpo
Selfie image of the subject in Base64 (PNG/JPG).
Optional. When false (default), a selfie with another person in frame returns MULTIPLE_FACES_DETECTED. When true, the largest face in the image is evaluated and the others are ignored.
Respuesta
Liveness analysis result (Strict Envelope Pattern).
High-level outcome. OK means the request was successfully processed (regardless of business result). ERROR means the request was rejected or could not be processed.
OK, ERROR Stable result type code. Includes generic codes (SUCCESS, INVALID_REQUEST, UNAUTHORIZED, SERVICE_UNAVAILABLE, INTERNAL_ERROR, RATE_LIMIT_EXCEEDED) plus endpoint-specific result codes — see this endpoint's response examples.
Human-readable summary of the result. Always in English (per Language Conventions in the API overview).
Unique identifier of this request, generated by the API Gateway. Propagated end-to-end for traceability.
ISO 8601 datetime with Mexico City offset (-06:00). Always set by the API Gateway when the response leaves the system.
Whether this request will be charged against the client's plan. Typically true for successful business results and false for validation errors or system errors that prevented processing.
Liveness result. Null for INVALID_REQUEST, INTERNAL_ERROR and SERVICE_UNAVAILABLE. On every OK outcome the object is present: when nothing could be evaluated (NO_FACE_DETECTED, MULTIPLE_FACES_DETECTED, IMAGE_UNREADABLE) isLive is false and the remaining fields are null.
Per-field error details. Present only on INVALID_REQUEST responses.