Quick start
This walks through one verification with curl. The same calls are wrapped by the TypeScript and Java clients.
-
Get a test key.
There is no self-serve signup yet. Request access and we will set up your app and give you a test key (
rk_test_…) and later a live key (rk_live_…). Each key is shown once; keep it in your secret store.Terminal window export RIGHTFUL_KEY=rk_test_… -
Save a workflow.
A workflow lists the checks. This one asks for three random gestures, then the light check, then a photo ID, and matches the live face against the ID portrait. Each
PUTcreates a new version and activates it.Terminal window curl -X PUT https://api.rightful.id/v1/workflows/onboarding-id \-H "Authorization: Bearer $RIGHTFUL_KEY" -H 'Content-Type: application/json' \-d '{"schema": "rightful.workflow/v1","key": "onboarding-id","ui": {"return_origins": ["https://app.example.com"]},"steps": [{"id": "liveness", "type": "gestures", "config": {"count": 3}},{"id": "light", "type": "light"},{"id": "id_photo", "type": "id_portrait"},{"id": "match", "type": "face_match", "config": {"against": [{"step": "id_photo"}]}}]}'Steps without an
onblock use the default policies: retry once when unclear, retry twice on a capture problem, then send to review. See the workflow DSL and the example workflows. -
Create a session.
Terminal window curl https://api.rightful.id/v1/sessions \-H "Authorization: Bearer $RIGHTFUL_KEY" -H 'Content-Type: application/json' \-H 'Idempotency-Key: onboarding:user_42:1' \-d '{"workflow": "onboarding-id","namespace": "customers","subject_ref": "user_42","locale": "en","return_url": "https://app.example.com/verified"}'The response is the session, plus
url. Store the sessionidagainst your user, then redirect the person tourl. Theurlis only returned here.{"id": "ses_…","object": "session","mode": "test","status": "created","decision": null,"url": "https://verify.rightful.id/s/ct_…","…": "…"} -
Wait for the person to come back.
When they finish, the page sends them to your
return_urlwith?session_id=…&status=…appended. Those parameters are not authenticated: use them only to know which session to look up. -
Read the result.
Terminal window curl https://api.rightful.id/v1/sessions/ses_… -H "Authorization: Bearer $RIGHTFUL_KEY"Poll until
statusiscompleted,expiredorcancelled. Every few seconds while the person is on the page is enough. Also poll from a background job, for people who close the tab.{"status": "completed","decision": "review","declared_decision": "approved","assurance": "experimental","reason": null,"checks": [{"step": "liveness", "type": "gestures", "outcome": "passed", "reasons": [], "policy_version": "fast-gestures-v1"},"…",{"step": "match", "type": "face_match", "outcome": "passed", "reasons": [], "band": "strong", "policy_version": "local-sface-2021dec-mirror@bands-v2"}],"review": {"status": "pending", "url": "https://verify.rightful.id/r/ses_….…", "expires_at": "…"}}Act on
decision. Here the workflow declaredapproved, but this app does not have automatic decisions on, so the result isreviewand a review link is ready for your reviewer. See decisions and assurance. -
Erase when you are done.
Terminal window curl -X DELETE https://api.rightful.id/v1/subjects/customers/user_42 -H "Authorization: Bearer $RIGHTFUL_KEY"