Skip to navigation

Re-authenticate a verified person by face

Matches a live selfie against the reference enrolled when the person was verified, and answers in the same call. A liveness failure and a face that does not match are both 200 responses with authenticated: false. A hosted verification session token is also accepted in place of a key.

An unknown reference, a business, and a person who is not enrolled all answer the same 404 not_enrolled, so references cannot be probed.

Sandbox. Outside production the comparison is simulated and free. The outcome is authenticated unless sandboxOutcome pins another, or the externalUserId contains no_match, nomatch or mismatch (no match) or bio_error or bioerror (error).

Billing. Production attempts are charged per attempt. A no_match is charged, because the check ran. An attempt that fails with 502 is refunded.

Scoped publishable keys. A scoped publishable key needs a biometric user token for this person in X-Toden-User-Token, minted by your server with POST /api/v1/user-tokens/biometric. Legacy publishable keys and secret keys do not.

A selfie belongs to one person. Retrying the same selfie for the same person returns the original result and any proof not yet redeemed, with no second charge. The same selfie sent for a different person answers 409 selfie_already_used, with no charge and no proof.

Error codes

errorStatusMeaning
invalid_request400The body failed validation.
handoff_session_expired401The hosted session token has expired.
insufficient_credits402The organisation’s balance cannot cover the attempt. The message is written for the end user and does not mention credit.
environment_mismatch403The key belongs to an environment this deployment does not serve.
origin_not_allowed403The publishable key has an origin allowlist and the request origin is not on it.
ip_not_allowed403The secret key has an IP allowlist and the calling address is not on it.
organization_suspended403The organisation is suspended. The response carries reason and suspendedAt.
business_not_approved403A live key was used before the business was approved for production.
verifications_disabled403Every verification is switched off for the organisation. Nothing is charged.
user_token_required403A scoped publishable key sent no X-Toden-User-Token. Get a token from your server.
user_token_invalid403The token is unknown, expired, revoked, used up, for another person or purpose, or bound to another publishable key.
not_enrolled404There is no enrolled person under that reference.
handoff_session_busy409The hosted session is busy with another request. Retry shortly.
handoff_session_used409The hosted session has already been submitted.
selfie_already_used409This selfie was already used to authenticate a different person. Nothing is charged; take a new selfie.
rate_limited429The organisation’s hourly limit was reached.
too_many_attempts429With a user token: 10 face checks for this person in the last 15 minutes. Try again later.
authentication_failed502The comparison could not be completed.

A missing or unknown key answers 401, where error is a short sentence rather than a code.

Accepts a publishable (pk_) or secret (sk_) key.

Authentication

AuthorizationBearer

Send the API key as a Bearer token. Each operation states whether a publishable key is enough or a secret key is required. A scoped publishable key has Verification flow access, the fixed set flow.run, flow.config.read and verifications.status.read; a scoped secret key reaches what its scopes allow.

Headers

X-Toden-User-TokenstringOptionalformat: "^ut_(live|test|dev)_[A-Za-z0-9_-]{43}$"

A biometric user token for this person, minted by your server. Required with a scoped publishable key; legacy publishable keys and secret keys never read it.

Request

This endpoint expects an object.
externalUserIdstringRequired1-200 characters
Your reference for the person, the one their original verification was submitted with.
selfiestringRequired1-200 characters

The mediaId of a live selfie uploaded through the upload endpoint with type selfie.

livenessVideostringOptional1-200 characters

The mediaId of the liveness recording. Optional, and read by the server alongside the selfie when sent.

livenessobjectOptional

The liveness result reported by the capture. Required in effect: without it, or without a mode, the attempt answers liveness_failed.

sandboxOutcomestringOptional<=40 characters

Pins the simulated outcome outside production: authenticated, no_match or error, or live to run the real comparison on a development key. Ignored on live keys.

Response

The attempt ran. Read authenticated for the outcome.

authenticatedboolean
True only when the person passed liveness and the selfie matched their enrolled reference.
statusenum

authenticated, no_match when the faces did not match, or liveness_failed when the liveness result did not pass.

Allowed values:
confidencedouble or null
The similarity score on a 0 to 100 scale. Null when no comparison ran.
liveboolean
Whether the liveness result was accepted.
attemptIdstring
The id of this attempt, for your records.
tokenstringOptional

A single-use proof token, present only when authenticated is true. Your backend redeems it within 30 minutes to trust a result that came from a browser or app.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
502
Bad Gateway Error