Menu

Get started

Errors

Errors use the HTTP status code; the body is JSON with a detail field in one of three shapes. Branch on the status code first, then on the code inside.

Text
// A message
{ "detail": "Invalid API key" }

// A machine-readable code (+ details)
{ "detail": { "reason": "document_type_not_allowed", "allowed": ["passport"] } }
{ "detail": { "code": "tenant_not_live", "message": "Tenant is not approved for production; …" } }

// Field validation (422)
{ "detail": [ { "type": "missing", "loc": ["header", "X-Api-Key"], "msg": "Field required" } ] }
STATUSMEANINGWHAT TO DO
400Bad request (e.g. webhook test without a secret)Fix the request
401Missing, unknown or revoked API key; or a session token that does not work (code below)Check the key; for a session token see the codes below
402Production balance is insufficientTop up in Panel → Balance
403tenant_not_live; a module that is switched off (module_disabled)Use a sandbox key, or switch the module on in the panel
404No such session or applicant for this key and environmentCheck the id and the key's environment
409Wrong state for this step (upload before document details, retry after a final decision …)Retrieve the session and follow its status
413 · 415Image too large / not an imageSee Upload document images
422Invalid field or a rule (detail.reason)Fix the input; do not retry unchanged
429Rate or daily limit (Limits); body {"error": …} or {"detail": "Velocity limit …"}Back off; daily limits reset over 24 h
5xxOur sideRetry with backoff; with Idempotency-Key a retried Create session is safe

Session token errors (401)

The SDK steps answer 401 with {"detail": {"code": …, "message": …}}. Only session.expired means the session ended (the panel shows it as Expired); in every other case the session may still be running and your backend can issue a new link.

CODEMEANINGWHAT TO DO
token.missingNo Authorization: Bearer … headerSend the session's access_token
token.invalidNot a token we issued, or no such sessionCheck the token
token.expiredThe token's 15 minutes are over; the session is still runningIssue a new link with POST /v1/sessions/{id}/sdk-link
token.replacedA newer link was issued for this session (sdk-link, or a delivered link was opened)Use the newest link
session.expiredThe session expired (expired / abandoned)Create a new session