Liveness and location
A facial requirement asks the applicant to follow a gesture sequence the server chooses. A location requirement checks the fix the device reports against your profile's rules. Both give your reviewers evidence. Neither proves who the applicant is.
The hosted verification page and all five applicant SDKs run these steps the same way. The numbers, gestures, error codes and applicant copy on this page come from the public SDK spec that every client is generated from.
What the checks show
- The camera recorded a sequence of gestures that the server chose, and the evidence arrived before the challenge expired.
- Your reviewers get a frame for each gesture, the selfie and, when you ask for it, a short video.
- The location fix met your accuracy and age limits, and the server compared it with the network country and your reference places.
The checks do not prove that a live person was in front of the camera. They do not detect deepfakes, replayed video, virtual cameras or spoofed locations. The camera source and the mock location flag are reported by the device. Treat them as signals for a reviewer, not as decisions. The session response says so in capabilities: trusted_camera is false, liveness is "challenge" and deepfake_detection is false.
Configure the profile
Add facial_verification or location_verification to a profile's verification_requirements, in the profile editor or through the management API. An entry can be the type name alone, or an object with verification_type and settings. Unknown settings are rejected. Settings you leave out get the defaults below, so clients always receive complete settings in profile.verification_requirements[].settings.
[
{
"verification_type": "facial_verification",
"settings": {
"gesture_count": 2,
"record_video": true
}
},
{
"verification_type": "location_verification",
"settings": {
"max_accuracy_m": 50,
"ip_country": "reject"
}
}
] A case keeps the settings it was created with. Editing a profile changes new cases only.
Facial settings
| Setting | Allowed | Default | Meaning |
|---|---|---|---|
gestures | Any of blink, smile, turn_left, turn_right, nod (at least 1) | blink, smile, turn_left, turn_right, nod | Gestures the server may pick from. |
gesture_count | 1 to 5 | 3 | How many gestures one challenge asks for. It cannot be larger than the number of allowed gestures. |
record_video | true or false | true | Record a short video, without sound, while the applicant follows the challenge. |
Location settings
| Setting | Allowed | Default | Meaning |
|---|---|---|---|
max_accuracy_m | 5 to 5000 | 100 | Largest accepted accuracy radius of the fix, in meters. |
max_age_s | 5 to 3600 | 60 | Oldest accepted fix, in seconds, measured against the server clock. |
mock_location | reject, flag, allow | reject | What to do when the device reports a mock location. |
ip_country | reject, flag, off | flag | What to do when the country of the network address differs from the country of the coordinates. |
reference | Object, or null | null | Optional places the applicant must be at or away from. |
places | 1 to 50 places | None | The places to check. |
id | Text, up to 64 characters | None | Your identifier for the place. |
label | Text, up to 120 characters | None | Name the applicant sees, such as Head office. |
latitude | -90 to 90 | None | Latitude of the place. Never sent to the applicant. |
longitude | -180 to 180 | None | Longitude of the place. Never sent to the applicant. |
radius_m | 0 to 100000 | None | Radius of the circle around the place, in meters. 0 means the place must fall inside the accuracy circle of the fix. |
rule | within, outside | within | within: be inside a place circle. outside: be outside it. |
match | any, all | any | any: one place is enough. all: every place must pass the rule. |
confidence | strict, lenient | strict | strict: the whole accuracy circle must pass. lenient: overlapping circles are enough. |
on_mismatch | reject, flag | reject | reject: refuse the location. flag: accept it and flag it for review. |
The liveness challenge
The applicant cannot choose the gestures. The client asks for a challenge right before the camera step starts.
- Request a challenge:
POST /sdk/sessions/{session}/liveness-challengeswith the session token, orPOST /client/verifications/{id}/liveness-challengeson the hosted page. The server picksgesture_countgestures from the allowed list at random, without repeats. - Run the gestures in the order given. The client shows a mirrored front camera preview and position hints until one face is centered and the right size.
- When each gesture completes, keep that camera frame and upload it as a
gesture. - Take the selfie and upload it as a
selfie. Every upload carries thechallenge_idandcapture_source=camera. - When
record_videois true, record the challenge without sound and upload it as aliveness_video, at mostmax_video_secondslong. - Submit a
facial_verificationwith thechallenge_id, the selfie file, the gesture files in the issued order and the video file.
A 201 response from the challenge request:
{
"success": true,
"message": "Liveness challenge issued",
"data": {
"challenge_id": "01a1fb8d-6c01-7160-a4fe-31853bb8dbdd",
"gestures": [
"nod",
"turn_right",
"turn_left"
],
"expires_at": "2026-11-21T00:43:51.000000Z",
"record_video": true,
"max_video_seconds": 8
}
} Gestures
Every client runs the same gesture engine on normalized face signals. eye_open and smile run from 0 to 1. yaw is positive when the applicant turns to their own left, and pitch is positive when they tilt their head up. Each gesture must finish within 10 seconds, and losing the face for 1 second or more restarts it.
| Gesture | The applicant sees | The engine looks for, in order |
|---|---|---|
blink | Blink | eye_open above 0.6, then eye_open below 0.3, then eye_open above 0.5 |
smile | Smile | smile above 0.6 for 5 samples in a row |
turn_left | Slowly turn your head to your left, then back | yaw above 20°, then yaw back within 10° of 0 |
turn_right | Slowly turn your head to your right, then back | yaw below -20°, then yaw back within 10° of 0 |
nod | Nod: look down, then back up | pitch below -15°, then pitch back within 10° of 0 |
Smile thresholds differ by face provider: mediapipe uses smile 0.4; mlkit uses smile 0.7. The web uses MediaPipe Face Landmarker. Swift, and React Native and Flutter on iOS, use Apple Vision. Kotlin, and React Native and Flutter on Android, use ML Kit.
Uploads
Send each file to POST .../uploads/biometrics as multipart form data.
type | Extra fields | File |
|---|---|---|
gesture | challenge_id, gesture, capture_source=camera | One JPEG frame, taken when the gesture completed. |
liveness_video | challenge_id, capture_source=camera | mp4, mov or webm, at most max_video_seconds long (8 seconds). |
selfie | challenge_id, capture_source=camera | A JPEG, PNG or WebP still. |
Then submit to POST .../submit, with the gesture files in the order the challenge listed them:
{
"type": "facial_verification",
"challenge_id": "01a1fb8d-6c01-7160-a4fe-31853bb8dbdd",
"image_file_id": 14,
"gesture_file_ids": [10, 11, 12],
"video_file_id": 13,
"metadata": {
"provider": "mediapipe",
"liveness_results": [
{"challenge": "nod", "completed": true, "timestamp": "2026-11-21T00:42:01.000Z"},
{"challenge": "turn_right", "completed": true, "timestamp": "2026-11-21T00:42:04.000Z"},
{"challenge": "turn_left", "completed": true, "timestamp": "2026-11-21T00:42:07.000Z"}
],
"face_detection": {
"detected": true,
"face_count": 1,
"is_centered": true,
"is_correct_size": true
},
"captured_at": "2026-11-21T00:42:09.000Z"
}
} provider is mediapipe, mlkit or vision.
Expiry and single use
- A challenge expires 120 seconds after it is issued. Every frame, the video and the selfie must be uploaded inside that window, and the submission must arrive before it expires.
- A challenge can be used for one facial submission.
- Requesting a new challenge cancels any unused earlier challenge for the same case.
- Challenge requests are limited to 20 a minute.
When a timeout, an expiry or one of the challenge codes below stops the step, the clients offer a retry that requests a new challenge. Never reuse the old one.
Location checks
The client asks for permission, takes a high accuracy fix and makes up to 3 attempts, waiting up to 30 seconds for each, until the fix meets max_accuracy_m and max_age_s. Then it submits:
{
"type": "location_verification",
"latitude": 4.0511,
"longitude": 9.7679,
"metadata": {
"accuracy": 12.5,
"altitude": null,
"fix_time": "2026-11-21T10:00:00.000Z",
"is_mock": null,
"provider": "browser",
"captured_at": "2026-11-21T10:00:02.000Z"
}
} The server then checks, in this order:
| Check | Server action |
|---|---|
| Accuracy | Rejects when accuracy is missing or larger than max_accuracy_m. |
| Fix age | Rejects when fix_time is missing, older than max_age_s, or in the future. 30 seconds of clock difference are allowed both ways. |
| Mock location | reject refuses a fix with is_mock: true. flag accepts it and flags it for review. allow ignores it. is_mock: null means the client cannot tell, and is never treated as a mock. |
| Network country | Compares the country of the request's IP address with the country of the coordinates. reject refuses a mismatch, flag flags it, off skips the check. |
| Reference places | Checks the fix against your places when the profile or case has them. |
Where the mock flag comes from
| Client | is_mock |
|---|---|
| Hosted page and JavaScript SDK | Always null. Browsers do not expose it. |
| React Native | The Android mock flag. null on iOS. |
| Flutter | The Android mock flag, and on iOS whether the system marks the fix as simulated by software. |
| Swift | Whether iOS marks the fix as simulated by software. |
| Kotlin | The Android mock flag (isMock on Android 12 and newer, isFromMockProvider before). |
Network country
The server looks up the IP country in a local copy of the DB-IP IP to Country Lite database, and the coordinates in a local copy of the Natural Earth country boundaries. No request leaves the server for either lookup. The result is stored as matched, mismatch or not_checked. Only a mismatch can reject.
not_checked reason | When |
|---|---|
disabled | ip_country is off. |
private_ip | The request came from a private, reserved or carrier grade NAT address. |
ip_country_unknown | The database has no country for the address. |
country_lookup_unavailable | The datasets are not installed on the server. |
no_country | The point is not in any country, for example at sea. |
disputed_territory | The point is in an area with no assigned country code. |
near_border | The point is within 10 km of another country, and the IP country is one of those countries. |
Near a border, an IP country that is none of the nearby countries still counts as a mismatch. VPNs, mobile roaming and corporate networks often place an applicant in another country, so flag is the default.
Reference places
A location requirement can check that the applicant is at, near or away from known places, such as an office or a declared address.
"reference": {
"places": [
{"id": "hq", "label": "Head office", "latitude": 4.0511, "longitude": 9.7679, "radius_m": 50}
],
"rule": "within",
"match": "any",
"confidence": "strict",
"on_mismatch": "reject"
} - Distance. The server measures the great circle distance from the fix to each place, in meters.
- within or outside.
withinpasses when the applicant is inside a place's circle.outsidepasses when they are outside it. - any or all.
anyneeds one place to pass.allneeds every place to pass. Useoutsidewithallto require being away from every listed place. - strict or lenient. The fix's accuracy is a circle too.
strictneeds the whole accuracy circle to pass: forwithin, distance plus accuracy is at most the radius.lenientpasses when the circles overlap: distance minus accuracy is at most the radius. Foroutsidethe two are mirrored. - Radius 0. The place must fall inside the fix's accuracy circle (or outside it, for
outside).confidenceis ignored. - reject or flag.
rejectrefuses the location.flagaccepts it and flags it for review.
Places for one case. Pass location_places, in the same shape as places, when you create a case with POST /client/verifications or in the dashboard. They replace the profile's places for that case only and need a profile with a location requirement. Give coordinates; the server does not geocode addresses.
What the applicant sees. Clients receive only rule, match and the place labels, never coordinates or radii, so the app can say "Share your location at Head office". Only the server decides whether the fix matched. The stored result has the outcome (matched, not_matched or not_configured), the nearest place with its distance, and the accuracy used.
Request keys and retries
Send an X-Idempotency-Key header with a UUID on every SDK session upload and submission, and on every biometrics upload from the hosted page. Hosted submissions accept a key too.
- Reuse the key when you retry the same request after a dropped connection. The server returns the first response instead of storing the evidence twice.
- Use a new key for a new attempt, such as a retaken selfie or a new location fix.
- Only successful responses are replayed. A retry after a
422is checked again. - Reusing a key with different data returns
409.
Rejection codes
Every 422 from a capture rule has a stable code next to message and errors. Match on code. message is written for people and can change. Other validation errors have no code.
{
"success": false,
"message": "The location fix is too old. Share your current location again.",
"errors": [],
"code": "location.stale"
} | Code | When | The applicant sees in the SDKs | Button |
|---|---|---|---|
location.accuracy | Accuracy is missing or larger than max_accuracy_m | Location not precise enough Your location is not accurate enough yet. Move near a window or outside, then try again. or Your location is not precise enough to check this place. Move near a window or outside, then try again. | Try again |
location.stale | fix_time is missing, older than max_age_s plus clock_skew_s, or in the future | Location out of date Your location reading is out of date. Try again to take a new one. | Try again |
location.mock | is_mock is true and mock_location is reject | Location is being changed An app or setting is changing your device location. Turn it off, then try again. | Try again |
location.ip_country | The IP country does not match and ip_country is reject | Connection in another country Your internet connection seems to be in a different country from your location. Turn off any VPN or proxy, then try again. | Try again |
location.reference_not_matched | The place rule failed and on_mismatch is reject | Location does not match Your location does not match the place requested by {verifier}. Try again from the right place. or You do not seem to be at {place} yet. Move closer, then try again. or You seem to be too close to {place}. Move away, then try again. | Try again |
liveness.challenge_invalid | The challenge is unknown, belongs to another case or was replaced | Start this step again This attempt can no longer be used. Start this step again. | Start again |
liveness.challenge_expired | The challenge expired | Time ran out This step timed out. Start it again. | Start again |
liveness.challenge_used | The challenge was already used | Start this step again This attempt can no longer be used. Start this step again. | Start again |
liveness.gesture_mismatch | A gesture frame is missing, extra, out of order or for a gesture the challenge does not include | Movements did not match Some movements were missing or out of order. Start this step again and follow each prompt. | Start again |
liveness.frame_out_of_window | A file was uploaded before the challenge was issued or after it expired | Time ran out This step timed out. Start it again. | Start again |
liveness.not_camera | Evidence was not uploaded with capture_source=camera for this challenge | Camera needed This step needs photos taken with the camera during the step. Start it again and use the camera. | Start again |
liveness.video_missing | record_video is on and no video for this challenge was sent | Recording missing The recording of this step did not arrive. Start the step again. | Start again |
liveness.video_too_long | The video is longer than max_video_seconds plus one second | Recording too long The recording was longer than allowed. Start the step again and follow the prompts without pausing. | Start again |
liveness.video_unreadable | The server cannot read the video duration | Recording could not be read We could not read the recording. Start the step again. | Start again |
The copy and the button come from the rejection screen map in the SDK spec. For location.accuracy and location.reference_not_matched, the later lines replace the first when the requirement has reference places; for a place mismatch the line depends on rule, and {place} is the place labels. Start again requests a new challenge.
What reviewers get
- The selfie, one frame for each gesture with its gesture name, and the video with its length.
- Links to these files are signed and expire after 15 minutes. Load the case again to get fresh links.
- A profile can set
video_retention_days. Once a video is older than that, a daily job hides it from reviewers and the case shows when it was hidden. Credflare keeps the file. Without the setting, the video stays visible. Applicants and SDKs never receive this setting. - Review flags. Facial:
face_not_detected,face_not_centered,face_size_warning,multiple_faces,incomplete_livenessandchallenge_incomplete. Location:mock_location,poor_accuracy,ip_country_mismatch,ip_country_not_checkedandreference_not_matched. - For location: the accuracy, the fix age, the mock flag and policy, the network country result with its reason, and the reference place outcome.
What the applicant sees




Rendered by the JavaScript SDK in headless Chrome against recorded API responses. Chrome's test camera has no face, so the gesture signals were replayed from the spec's test traces.
Data credits
IP Geolocation by DB-IP, licensed under CC BY 4.0. Country boundaries from Natural Earth.