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.
| Parameter | In | Type | Notes |
|---|---|---|---|
idempotency-key | header | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
namespace | query | string | |
subject_ref | query | string | |
status | query | string | |
limit | query | integer | |
created_after | query | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
session_idrequired | path | string | |
evidence_idrequired | path | string |
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}.
| Parameter | In | Type | Notes |
|---|---|---|---|
namespacerequired | path | string | |
subject_refrequired | path | string |
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}.
| Parameter | In | Type | Notes |
|---|---|---|---|
keyrequired | path | string | |
version | query | integer |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
keyrequired | path | string | |
activate | query | boolean |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
keyrequired | path | string | |
versionrequired | query | integer |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
reference_sessionrequired | query | string | |
track_id | query | string | |
segment_label | query | string | |
idempotency-key | header | string |
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.
| Parameter | In | Type | Notes |
|---|---|---|---|
from | query | string | |
to | query | string | |
group_by | query | string |
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.
| Field | Type | Notes |
|---|---|---|
workflowrequired | string | |
workflow_version | integer | |
namespace | string | |
subject_refrequired | string | |
locale | "en" | "fr" | "ar" | "es-419" | "pt-BR" | "pt" | "sw" | "ha" | "yo" | "ig" | "am" | |
reference_images | ReferenceImage[] | |
reference_sessions | ReferenceSession[] | |
reference_voices | ReferenceSession[] | |
subject_name | string | |
consent | ConsentAttestation | |
return_url | string | |
metadata | object | |
simulate | map of string |
ReferenceImage
Unknown fields are rejected.
| Field | Type | Notes |
|---|---|---|
labelrequired | string | |
imagerequired | string |
ReferenceSession
Unknown fields are rejected.
| Field | Type | Notes |
|---|---|---|
labelrequired | string | |
session_idrequired | string |
ConsentAttestation
Unknown fields are rejected.
| Field | Type | Notes |
|---|---|---|
referencerequired | string | |
atrequired | string | |
text_version | string |
ReviewDecision
Unknown fields are rejected.
| Field | Type | Notes |
|---|---|---|
decisionrequired | "approved" | "declined" | |
by | string | |
note | string |
Compare
Unknown fields are rejected.
| Field | Type | Notes |
|---|---|---|
referencerequired | string | |
liverequired | string |