Skip to main content

Active Liveness API

Generate and verify active liveness challenges.

Generate Challenge

Generate a random challenge for the user to perform.

POST /verifications/{id}/active-liveness/challenge
Authorization: Bearer vyd_xxx

Path Parameters

ParameterTypeDescription
idstringVerification ID

Response

{
"challenge_id": "ch_a1b2c3d4e5f6",
"challenge_type": "blink",
"instructions": "Please blink your eyes once",
"timeout_secs": 10
}
FieldTypeDescription
challenge_idstringUnique challenge identifier
challenge_typestringOne of: blink, turn_left, turn_right, nod, smile
instructionsstringHuman-readable instructions to display
timeout_secsintegerSeconds to complete the challenge

Permissions

Requires active_liveness:run permission.


Verify Challenge

Submit captured frames to verify the user completed the challenge.

POST /verifications/{id}/active-liveness/verify
Authorization: Bearer vyd_xxx
Content-Type: multipart/form-data

Request Body (multipart/form-data)

FieldTypeRequiredDescription
challenge_typestringYesChallenge type that was generated
filefile[]YesOne or more frame images

Example

curl -X POST https://api.dev.valydar.com/verifications/vry_xxx/active-liveness/verify \
-H "Authorization: Bearer vyd_xxx" \
-F "challenge_type=blink" \
-F "file=@frame1.jpg" \
-F "file=@frame2.jpg" \
-F "file=@frame3.jpg"

Response

{
"passed": true,
"score": 0.82,
"checks": [
{
"name": "blink_detection",
"passed": true,
"score": 0.82,
"reason": "detected eye brightness dip of 23.5%, consistent with blink"
}
]
}
FieldTypeDescription
passedbooleanWhether the challenge was completed successfully
scorefloatConfidence score (0.0 to 1.0)
checksarrayDetailed check results

Errors

StatusDescription
400No frames uploaded or invalid challenge type
401Invalid API key
403Missing active_liveness:run permission
404Verification not found

Permissions

Requires active_liveness:run permission.