Liveness check
Check one selfie for liveness: whether the face in it is a real person in front of the camera, or a printed photo or a screen held up to it. The answer comes back in the same response: the outcome, a score from 1 to 100, and what was seen. It is the same check Spot Checks runs from the dashboard (Spot Checks → Individual → Liveness), and every check is kept in the same history (checks run here are labelled “API”).
Authentication: Authorization: Bearer sk_… (secret keys only). A selfie is biometric data, so this never belongs in client-side code.
What a single photo can and cannot show
Toden’s passive liveness model reads the face in the photo, exactly as it reads the selfie of a verification. A phone detector looks for a phone touching the face, and the photo is measured for glare, a screen-like pattern, straight edges framing the face, focus, light and how the face is turned.
A single still is weaker evidence than a live capture. A verification also scores a short clip of the person and can ask them to turn their head, which no photo can show. A good print or a high-quality screen can pass a photo check that a live capture would catch, and a photo cannot show a phone being brought up to the camera. Use this check to screen a photo you already hold. Do not use it in place of liveness on a live capture: for that, run a verification.
Upload the selfie, then check it
- Upload the photo with
POST /api/v1/upload,typeselfie. JPEG, PNG or WebP. - Send the
mediaIdit returns asselfieMediaIdwithin 30 minutes. The upload must be your own, in the same environment (a sandbox key cannot check a production upload), and not already used by a verification.
A new check answers 201; a retry with the same requestId answers 200 with the check already run.
Outcomes
The outcome is set cautiously, because a photo is weaker evidence than a live capture:
A phone at or above phone.declineAt declines a verification, but here it is held for review: a still cannot show the phone being brought up to the camera, which is what that line was measured on.
unavailable means the check could not be completed. It was not charged and is never a pass; run it again with a new requestId (and a clearer photo for no_face).
The result
New fields may be added to result; existing ones are never renamed.
Once the check is answered, the selfie is kept with it, so your team can see the photo on the result in the dashboard. In production it is kept as long as your media retention allows; in sandbox, for 3 days. A check that could not be completed keeps nothing, and the upload expires after 30 minutes.
History
GET /api/v1/checks/liveness lists your liveness checks in this environment, newest first, with outcome, page and pageSize (at most 100) as filters. GET /api/v1/checks/liveness/:id returns one check. DELETE /api/v1/checks/liveness/:id removes it from your history; the delete is soft and nothing is refunded.
Billing
Each check is charged at your Verifications price for Presence Intelligence (Passive), the passive liveness check, in production only. A check that could not be completed (unavailable: no face found, or the model unavailable) is not charged, and a retry with the same requestId is never charged again. Sandbox and development checks are free.
Sandbox
Outside production the model runs for real on your photo, at no charge. There are no test photos with fixed answers, and no canned pass: a deployment without the model answers check_unavailable (or unavailable with model_unavailable) rather than a result it did not read. To see a review or fail, check a photo of a photo, or of a face on a screen.