Skip to content

API reference

This page is generated from the service’s own OpenAPI schema each time the site is built, so the endpoints, parameters and request fields always match the code. The session object is described with the concepts.

Errors are JSON: {"code": "SESSION_NOT_FOUND", "detail": …}. detail is a string, or for invalid requests a list of {loc, msg}.

Base URL https://api.rightful.id. Every call needsAuthorization: Bearer rk_test_… or rk_live_…; a missing or revoked key is401 UNAUTHENTICATED. Generated from version 0.1.0 of the service’s OpenAPI schema.

Sessions

Create a verification, poll it, review it, cancel or erase it. See Sessions.

Create a session

POST/v1/sessions

Creates a session on the active version of workflow (or workflow_version). Returns 201 with the session object plus url, the hosted page to send the person to, and client_token. Both appear only in this response, so store url now. Send an Idempotency-Key: a retry with the same key and the same body returns the same session for 24 hours; the same key with a different body is 409 IDEMPOTENCY_KEY_REUSED. Errors include 404 WORKFLOW_NOT_FOUND, 422 REFERENCE_IMAGES_MISMATCH, 422 SUBJECT_NAME_REQUIRED, 422 CONSENT_REQUIRED, 422 RETURN_URL_NOT_ALLOWED and, with a live key, 422 SIMULATE_TEST_MODE_ONLY.

ParameterInTypeNotes
idempotency-keyheaderstringlength ≤ 128.

Body: CreateSession

Responses: 201 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

List sessions

GET/v1/sessions

Returns {"object": "list", "data": [session, …]}, newest first. Filter by namespace, subject_ref, status or created_after (ISO 8601). List items never include checks.

ParameterInTypeNotes
namespacequerystring
subject_refquerystring
statusquerystring
limitqueryintegerDefault 50.value 1–200.
created_afterquerystring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Get a session

GET/v1/sessions/{session_id}

The session object: status, decision, declared_decision, assurance, reason, and on completed sessions the per-step checks (when the workflow’s output.detail is checks or scores), evidence and review. This is how your app gets results: there are no webhooks yet. 404 SESSION_NOT_FOUND for a session of another app.

ParameterInTypeNotes
session_idrequiredpathstring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Erase a session

DELETE/v1/sessions/{session_id}

Erases the session’s data and any retained evidence. Returns 204. A tombstone (id, namespace, outcome, times) and the usage counts remain; subject_ref and metadata are cleared.

ParameterInTypeNotes
session_idrequiredpathstring

Responses: 204 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Decide a review

POST/v1/sessions/{session_id}/review

Your own reviewer approves or declines a completed session whose decision is review. This works whatever the workflow’s review.decide_in. The first decision, here or on the hosted review page, is final; any later one is 409 REVIEW_NOT_PENDING. Returns the updated session.

ParameterInTypeNotes
session_idrequiredpathstring

Body: ReviewDecision

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Cancel a session

POST/v1/sessions/{session_id}/cancel

Ends a session that has not finished. Returns the session with status: "cancelled". A finished session gives 409 SESSION_ALREADY_FINISHED.

ParameterInTypeNotes
session_idrequiredpathstring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

List retained evidence

GET/v1/sessions/{session_id}/evidence

Returns {"object": "list", "data": [{id, kind, retain_until}]}. Empty unless the workflow’s output.evidence keeps images. See evidence.

ParameterInTypeNotes
session_idrequiredpathstring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Download one image

GET/v1/sessions/{session_id}/evidence/{evidence_id}

The decrypted JPEG, with Cache-Control: no-store. Only the app that owns the session can download it, and each download is counted as evidence.download. 404 EVIDENCE_NOT_FOUND once it has expired or been erased. An object that fails its integrity check returns 500 EVIDENCE_UNREADABLE, never bytes.

ParameterInTypeNotes
session_idrequiredpathstring
evidence_idrequiredpathstring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Subjects

Every session for one person, by your own reference.

Erase a person

DELETE/v1/subjects/{namespace}/{subject_ref}

Erases every session of your app with this namespace and subject_ref, and their evidence. Returns {"erased_sessions": n}.

ParameterInTypeNotes
namespacerequiredpathstring
subject_refrequiredpathstring

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Workflows

Versioned workflow definitions. See the workflow DSL.

Validate a workflow

POST/v1/workflows/validate

The body is a workflow definition, including key. Nothing is saved. Returns {"valid": true, "plan": …, "effective_theme": …}: the plan shows the policy that applies to every outcome, defaults included. An invalid definition is 422 WORKFLOW_INVALID with a detail list of {loc, msg}.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Get a workflow

GET/v1/workflows/{key}

The active version, or the one named by version: {key, version, active, definition}.

ParameterInTypeNotes
keyrequiredpathstring
versionqueryinteger

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Save a workflow version

PUT/v1/workflows/{key}

The body is a workflow definition. Each call creates a new immutable version and, unless activate=false, makes it the active one. Sessions keep the version they started on. A key in the body that differs from the path is 422 WORKFLOW_KEY_MISMATCH.

ParameterInTypeNotes
keyrequiredpathstring
activatequerybooleanDefault true.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

List workflows

GET/v1/workflows

Every version of every workflow of your app: {"object": "list", "data": [{key, version, active, created_at}]}.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Activate a version

POST/v1/workflows/{key}/activate

Makes version the active one for new sessions. 404 WORKFLOW_NOT_FOUND if it does not exist.

ParameterInTypeNotes
keyrequiredpathstring
versionrequiredqueryintegervalue ≥ 1.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Theme

Your app’s default branding for the hosted page. See theming.

Get the theme

GET/v1/theme

Your app’s stored theme, or {} if none is set.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Set the theme

PUT/v1/theme

The body is a theme. Replaces the stored theme and returns it. An invalid theme is 422 THEME_INVALID. A workflow’s ui.theme still overrides it field by field.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Face comparison

A stateless 1:1 face match, outside any session.

Compare two faces

POST/v1/face/compare

Two base64 images. Returns the match status, an uncalibrated score, a band (strong, possible or weak, or unavailable when a face could not be found) and assurance: "experimental". Each call is counted as face.compare. 503 MATCHER_UNAVAILABLE when the server has no face matcher loaded.

Body: Compare

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Voice consistency

Does a later recording sound like the voice enrolled in a verified session? A review-only risk signal, never authentication.

Check a voice against an enrolled one

POST/v1/voice/verify

A WAV body (PCM 16-bit or float 32, at most 60 s and 6 MiB) with reference_session (a completed session that enrolled a voice), and optional track_id and segment_label query parameters. Returns a band (consistent, possible, inconsistent or inconclusive), the audio quality, the track so far, spoof: {assessed: false} and calibrated: false. A risk signal for review only, never authentication. 403 VOICE_NOT_ENABLED when voice is not enabled for live keys on the deployment. 409 VOICE_NOT_ENROLLED when the session kept no voice; 503 VOICE_UNAVAILABLE when no voice model is loaded. Each call is counted as voice.verify.

ParameterInTypeNotes
reference_sessionrequiredquerystringpattern ^ses_[A-Za-z0-9]{8,40}$.
track_idquerystringlength ≤ 128, pattern ^[A-Za-z0-9_.:-]+$.
segment_labelquerystringlength ≤ 64, pattern ^[A-Za-z0-9_.:-]+$.
idempotency-keyheaderstringlength ≤ 128.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Usage

What has been counted for your app.

Read usage

GET/v1/usage

Counts for your app between from and to (ISO 8601; the default is the last 30 days), grouped by any of day, kind, mode, workflow and namespace (default day,kind). The kinds are listed under usage.

ParameterInTypeNotes
fromquerystring
toquerystring
group_byquerystringDefault "day,kind".

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Capabilities

What this server supports.

Server capabilities

GET/v1/capabilities

Step types, gestures, locales, the policy id behind each step type and which are signed off, whether the face matcher, name reader and barcode reader are loaded, the theme copy keys, and webhooks: false.

Responses: 200 Successful Response; 422 Request invalid (REQUEST_INVALID, or a more specific code).

Request schemas

CreateSession

Unknown fields are rejected.

FieldTypeNotes
workflowrequiredstringpattern ^[a-z][a-z0-9-]{1,47}$.
workflow_versionintegervalue ≥ 1.
namespacestringDefault "default".length 1–128, pattern ^[A-Za-z0-9_.:-]+$.
subject_refrequiredstringlength 1–128, pattern ^[A-Za-z0-9_.:@-]+$.
locale"en" | "fr" | "ar" | "es-419" | "pt-BR" | "pt" | "sw" | "ha" | "yo" | "ig" | "am"
reference_imagesReferenceImage[]items ≤ 3.
reference_sessionsReferenceSession[]items ≤ 3.
reference_voicesReferenceSession[]items ≤ 3.
subject_namestringlength 1–200.
consentConsentAttestation
return_urlstringlength ≤ 2048, pattern ^https?://.
metadataobject
simulatemap of string

ReferenceImage

Unknown fields are rejected.

FieldTypeNotes
labelrequiredstringpattern ^[a-z][a-z0-9_]{0,31}$.
imagerequiredstringlength 16–5592405.

ReferenceSession

Unknown fields are rejected.

FieldTypeNotes
labelrequiredstringpattern ^[a-z][a-z0-9_]{0,31}$.
session_idrequiredstringpattern ^ses_[A-Za-z0-9]{8,40}$.

ConsentAttestation

Unknown fields are rejected.

FieldTypeNotes
referencerequiredstringlength 1–128.
atrequiredstringlength 10–40.
text_versionstringlength ≤ 32.

ReviewDecision

Unknown fields are rejected.

FieldTypeNotes
decisionrequired"approved" | "declined"
bystringlength ≤ 80.
notestringlength ≤ 500.

Compare

Unknown fields are rejected.

FieldTypeNotes
referencerequiredstringlength 16–5592405.
liverequiredstringlength 16–5592405.