Sessions
A session is one verification of one person against one workflow version.
Lifecycle
Section titled “Lifecycle”created ──▶ in_progress ──▶ completed │ │ └─────────────┴──▶ expired | cancelledcreated: the session exists; the person has not started.in_progress: the person has started the checks.completed: the workflow reached a decision.decisionis set.expired: the session’s time ran out (limits.session_ttl_seconds, 15 minutes by default) before it completed. While the person is taking their ID photo on a phone (the phone handoff), each thing the phone does keeps the session open for at least 10 more minutes, up to an hour after the session was created;expires_atmoves later accordingly.cancelled: your app cancelled it, or the person declined consent (reason: "consent_declined").
completed, expired and cancelled are final: a session never comes back from them. If the person needs another go, create a new session.
Creating one
Section titled “Creating one”POST /v1/sessions with at least workflow and subject_ref. Depending on the workflow you may also need:
reference_images: base64 photos, by the labels the workflow declares underinputs.reference_images;reference_sessions: an earlier session to match against (see below);subject_name: the name to compare with the ID, for aname_matchstep. It is held in memory only and never stored;consent: your own consent record, for workflows withconsent.mode: "app_attested";return_url: where to send the person afterwards. If the workflow setsui.return_origins, it must be on one of them;locale:en,fr,ar,es-419,pt-BR(Brazilian Portuguese),pt(European and African Portuguese),sw,ha,yo,igoram. The page opens in this language if the workflow’sui.localesinclude it, otherwise inui.default_locale; the person can switch among the workflow’s languages;metadata: your own JSON, returned on the session and shown on the review page.
Send an Idempotency-Key header. A retry with the same key and body returns the same session for 24 hours, so a network error never creates two sessions.
The response includes url, the hosted page for this session, only this once. The URL contains a secret: send it only to the person being verified.
Getting the result
Section titled “Getting the result”Your app reads results with GET /v1/sessions/{id}. A webhook can tell you when to; without one, read it:
- when the person comes back to your
return_url(it gets?session_id=…&status=…, which is only a hint, never a result); - every few seconds while you show a waiting screen;
- from a background job, for sessions still not final, because people close tabs.
GET /v1/sessions?status=in_progress and created_after help find the ones to check.
The session object
Section titled “The session object”| Field | Meaning |
|---|---|
id |
ses_… |
object |
Always "session". |
mode |
test or live, from the key that created it. |
status |
created, in_progress, completed, expired or cancelled. |
decision |
approved, declined or review, on completed sessions only; otherwise null. Act on this. |
declared_decision |
What the workflow itself decided. See decisions. |
assurance |
experimental or qualified. |
reason |
A short code for why, such as weak_match or consent_declined, or null. Workflows can set their own reasons. |
namespace, subject_ref |
Your references. |
workflow |
{key, version} the session runs on. |
locale, metadata, reference_sessions |
As sent. |
attempts |
How many capture attempts were made. |
created_at, completed_at, expires_at |
ISO 8601 times. |
checks |
On completed sessions, when output.detail is checks or scores: one entry per step of the final attempt with step, type, outcome, reasons, policy_version, band for face matches, and measurements with scores. See step reasons. |
evidence |
Retained images: [{id, kind, retain_until}]. See evidence. |
review |
For a review result: {status, url, expires_at} and, once decided, decision, by, note and at. See review links. |
Step reasons
Section titled “Step reasons”Each check’s reasons are short codes. Besides those specific to a check, these say how a capture step ended when it did not finish normally:
| Reason | Meaning |
|---|---|
skipped_by_person |
The person skipped this step (the light check, where the workflow allows it). The outcome is skipped. |
stopped_during_light |
Added to skipped_by_person when the person pressed Stop during the light check: where skipping is allowed, that counts as skipping it, and the check carries on. |
stopped_by_person |
The person pressed Stop. The outcome is capture_error, so the step’s capture_error policy applies (by default, another attempt). |
page_left |
The page was closed or reloaded mid-step. |
stopped |
The step ended for another reason, such as a camera or connection problem. |
virtual_camera |
On the movement check: the check ran on a virtual camera, so the session goes to review. |
id_screen_recapture, id_photocopy, id_liveness_not_computed |
On the ID check: the photo looks like a screen or a greyscale copy, or that could not be checked. The outcome stays passed; the session goes to review. |
Attempts and retries
Section titled “Attempts and retries”When a workflow policy says retry, the person goes through the whole capture chain again with fresh random gestures. Finished steps are not kept between attempts. limits.max_attempts caps the attempts (3 by default). If the person leaves after being offered a retry, the policy’s final action applies.
Matching against an earlier session
Section titled “Matching against an earlier session”A face_match can compare the live face with the face kept by an earlier session of the same person, instead of a photo you send. Pass it as reference_sessions: [{label, session_id}], where the label is one the workflow declares under inputs.reference_images. The earlier session must be completed, in the same mode, not erased, belong to the same namespace and subject_ref, and still have a retained live_face. The face never leaves the server. Introcall uses this to re-check a candidate during an interview.
A restart drops sessions in progress
Section titled “A restart drops sessions in progress”Capture state lives in the server’s memory. If the service restarts while someone is mid-check, that session cannot continue and will expire; your app sees expired when it polls. Create a new session.
Cancelling and erasing
Section titled “Cancelling and erasing”POST /v1/sessions/{id}/cancelends a session that has not finished.DELETE /v1/sessions/{id}erases one session, andDELETE /v1/subjects/{namespace}/{subject_ref}every session of one person. Erasing deletes any retained images at once and invalidates the review link. A tombstone remains (the session id, namespace, outcome and times), with the usage counts; yoursubject_ref,metadata, consent record and the per-check results are removed.