Sessions
A session is one verification attempt by one person. Start it, pass its ID as
session_id in the request part of every call in the attempt (liveness,
face-verify, voice-verify, face match, enrollments, document checks, deepfake
checks, consent), then end it. Ending it scores the liveness, face-verify and
voice-verify results together, and the face match when one ran, and returns the
session’s decision, which is the verification result. Document checks are
not part of it: check their own response.
Read the Sessions guide for the flow and its rules: a session is single-use and lasts 24 hours, and face and voice verification must run on the liveness media.
Start a session
Authorization
This endpoint requires an API token as Bearer in the Authorization header. Go to Authorization guide for details.
Request
POST https://api.biometrysolutions.com/api-gateway/v2/sessionsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
warmup | boolean | Optional. Set to true to pre-warm ML services in the background. See Warmup for details. |
Parameters
- No body parameters are required for this endpoint.
Headers
- Authorization* - Your API Token.
Responses
The success envelope. data.session_id contains the new session ID.
Response sample:
{ "data": { "session_id": "sess_fe402c29-b543-4413-8624-af1a2a0b2f2c" }, "meta": { "request_id": "fc5605c5-...-87cc-979cd72564d4", "message": "session started successfully" }}Sample
curl --location 'https://api.biometrysolutions.com/api-gateway/v2/sessions' \ --request POST \ --header 'Authorization: Bearer eyJhbGciO...ANYea8r2xOG-Urc'End a session
Ends the session and returns its decision: every check run in the session
(liveness, face-verify, voice-verify) scored together against the session’s
scoring system, with its face match counted when one ran: a failed match gives
reject. Use this decision as the verification result. A single call’s
own decision covers only that call.
After end, the session is closed. Every later call that names it is refused
with 409 session_ended. Calling end again returns the stored decision.
Authorization
This endpoint requires an API token as Bearer in the Authorization header. Go to Authorization guide for details.
Request
POST https://api.biometrysolutions.com/api-gateway/v2/sessions/{session_id}/endParameters (optional JSON body)
| Field | Type | Description |
|---|---|---|
phone_number | string | Optional. Phone number for a SIM-swap fraud check via the CAMARA API. |
Headers
- Authorization* - Your API Token.
Responses
decision.status is accept, refer or reject. decision.reasons
explains it, and decision.score is present when the scoring system
produced a score. See
Reading the session decision.
{ "decision": { "status": "refer", "reasons": [ "session incomplete: a required verification step did not run", "Voice Recognition produced no result" ] }, "meta": { "request_id": "fc5605c5-...", "message": "session ended successfully" }}Unknown session, or a session that belongs to another project.
{ "error": { "code": "not_found", "message": "session not found" }, "meta": {} }The session was closed by the cleanup job (more than 24 hours old) before
end was called, so it has no decision to return.
{ "error": { "code": "session_ended", "message": "session has ended; start a new session" }, "meta": {} }Sample
curl --location 'https://api.biometrysolutions.com/api-gateway/v2/sessions/sess_fe402c29-b543-4413-8624-af1a2a0b2f2c/end' \ --request POST \ --header 'Authorization: Bearer eyJhbGciO...ANYea8r2xOG-Urc'