Identity verification
Agents and owners verify their identity with Didit in the native apps and get a check next to their name (PRO-184). The web never starts a verification: it shows the status and sends people to the app.
How it fits together
Section titled “How it fits together”| Piece | Where | What it does |
|---|---|---|
| Session create, status, refresh | apps/api, tRPC identityVerification.* | Creates the Didit session and returns a token for Didit’s native SDK |
| Webhook | apps/api, POST /api/webhooks/didit | Receives status.updated, checks the signature, applies the outcome |
| Reconcile | apps/worker, queue identity | Every 15 minutes, reads Didit’s decision for sessions still open after 10 minutes, and re-reads approved sessions once a week in case an approval was withdrawn |
Status card, /get-app | apps/svelte-web | Read-only status and the way into the app |
Settings
Section titled “Settings”| Variable | Hosts | Meaning |
|---|---|---|
DIDIT_API_KEY | api, worker | The Didit application’s API key. Server-side only. |
DIDIT_WORKFLOW_ID | api, worker | The workflow the sessions run on. |
DIDIT_ENVIRONMENT | api, worker, web | sandbox (default) or live: which Didit application this deployment works against. Set the same value on all three: the web’s status card reads the sessions of that environment. |
DIDIT_WEBHOOK_SECRET | api | The webhook destination’s secret_shared_key. |
IDENTITY_VERIFICATION_ENABLED | api, worker, web | Env default of the identity-verification product flag. |
APP_STORE_URL_USER, APP_STORE_URL_AGENT, PLAY_STORE_URL_USER, PLAY_STORE_URL_AGENT | web | Store pages /get-app links to. Unset hides that button. |
The web holds no Didit key. With the key or the workflow id unset, identityVerification.start answers identity_verification_unavailable and the worker skips its scan.
DIDIT_ENVIRONMENT is a safety setting, not a label. Results from the other environment are ignored, so a sandbox approval can never mark a user verified on a host that runs against live. It is stated explicitly because older Didit keys carry no sk_test_ / sk_live_ prefix to read it from.
First setup, on a sandbox application
Section titled “First setup, on a sandbox application”A Didit application comes as a Live and a Sandbox environment. Sandbox mocks every check, bills nothing and allows 500 session creates a day.
-
Create the organisation in the Didit Business Console with a work email (console sign-up carries the Free plan’s monthly credit; an organisation created through the API starts at zero).
-
Switch to Sandbox and copy its API key (it starts with
sk_test_). -
Build the workflow from the KYC template: ID verification, passive liveness, face match, IP analysis. Limit the accepted documents to INE, passport and residence card. Note the workflow id.
-
In White Label, set the brand colours and logo. The native SDKs take their colours from here, not from the apps.
-
Add the webhook destination for the tier’s API host:
Terminal window curl -X POST https://verification.didit.me/v3/webhook/destinations/ \-H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" \-d '{"label":"DEV identity","url":"https://<api-host>/api/webhooks/didit","webhook_version":"v3","subscribed_events":["status.updated"]}'The response carries
secret_shared_key: that isDIDIT_WEBHOOK_SECRET. -
Put the four
DIDIT_*values in the tier’s Doppler config and redeployapiandworker. -
Turn the flag on for the tier (next section).
Do not add a Location step to the workflow without an app release. Didit’s Android SDK brings the two location permissions into each app’s manifest for that step, and both Android apps take them back out (the customer app keeps approximate location for its own Nearby rail, the agent app has none). With the step on and the permissions out, Android denies the request and the step cannot pass. The lines to restore are in each app’s AndroidManifest.xml.
Didit does not deliver webhooks to localhost or private addresses. A workstation relies on the app’s refresh call and on the reconcile scan instead, or on a tunnel.
Turning it on
Section titled “Turning it on”The identity-verification flag (boolean) exists in PostHog since 2026-11-20 and is on for environment = development. To turn it on for another tier, add a release condition environment = <tier> to it, as the product flags page describes. A tier that polls PostHog and matches no condition reads it as off; IDENTITY_VERIFICATION_ENABLED decides only where PostHog has no answer for the flag.
Off means: the apps hide the Verify identity entry, the web hides the status card, start refuses, and the identity worker is paused. Checks already earned keep showing.
Order for a new tier: keys and webhook first, then the flag. With the flag on and no keys, the apps show the entry and starting fails with a “not available” message.
Testing every outcome
Section titled “Testing every outcome”Force an outcome on a sandbox session with sandbox_scenario at creation (approve, decline_document_expired, decline_face_match_low_similarity, decline_liveness_attack, review_face_match_borderline), or afterwards:
curl -X POST https://verification.didit.me/v3/session/<session_id>/simulate/ \ -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" \ -d '{"new_status":"Declined"}'new_status takes Approved, Declined, In Review, Expired or Abandoned. The call sends the same webhooks a real change does.
Use Didit’s sample documents. Sandbox simulates the result but stores the captured photos for real, so never upload a real ID there.
Try Webhook in the console sends signed sample payloads marked X-Didit-Test-Webhook: true. The route answers 204 and changes nothing.
When a verification looks stuck
Section titled “When a verification looks stuck”- Find the row:
select id, status, "providerStatus", "providerSessionNumber", "lastEventAt", "updatedAt" from identity_verifications where "userId" = '<id>' order by "createdAt" desc; - Compare with the session in the Didit console (search by the session number).
- If Didit shows a later status, look at the destination’s Deliveries tab. A delivery that failed three times was dropped: the reconcile scan applies it within 15 minutes of the row going quiet. Resend in the console is also safe; the webhook dedupes on
event_id. apilogs one line per delivery,event: "didit.webhook_received", withactionand, when skipped or rejected,reason:
reason | Meaning |
|---|---|
mismatch, timestamp_stale, timestamp_missing | Signature check failed. Check DIDIT_WEBHOOK_SECRET against the destination. Didit does not retry a 401. |
unconfigured | DIDIT_WEBHOOK_SECRET is unset on api. |
wrong_environment | The event’s environment is not this host’s DIDIT_ENVIRONMENT. |
unknown_session | No row for that session id: it was created with another key or tier. |
duplicate, stale | Already applied, or older than what the row holds. Normal. |
In Review sessions wait for a person: approve, decline or request a resubmission in the Didit console. The outcome arrives like any other.
Rotating the webhook secret
Section titled “Rotating the webhook secret”Rotate in the Didit console, put the new value in Doppler, redeploy api. For 24 hours Didit also signs with the replaced secret (-Previous headers) and the route accepts either, so there is no window in which deliveries fail.
Account deletion
Section titled “Account deletion”The account purge deletes the user’s sessions at Didit with a privacy-erasure instruction and removes the local rows. It can only delete sessions of the host’s own Didit environment; sessions from the other one are counted in a log line (account_purge.didit_sessions_other_environment) and have to be deleted in the Didit console. A purge on a host whose Didit key was removed reports didit not configured and retries; restore the key rather than resolving it by hand.
Before going live
Section titled “Before going live”These are open and block a live key:
- Counsel: the consent wording shown in the apps, the privacy-notice text naming Didit and the processing of ID and biometric data, and the transfer to the EU. Didit stores data in the EU (Ireland) today; a Mexico location is announced, not available, and an application’s data location cannot be changed once it is created.
- Didit: a data-processing agreement, and the data-retention period in the console (the Free plan starts at one year).
- Stores: the App Store privacy labels and the Google Play Data safety form for all four apps (camera, microphone and photo access; ID and biometric data collected through a third-party SDK).
- Android release build: the release variants minify with R8 and CI builds debug only. Didit’s SDK ships its own keep rules, but its documentation says R8 full mode may need
android.enableR8.fullMode=false. Run one full verification on a release build before the store upload. - Store links: the four
*_STORE_URL_*values. - Name changes: what editing a name does to the check. Today nothing: the check marks the person, and the name next to it can still be edited.
Going live is then: create the workflow and the destination in the Live environment, set the live key, workflow id and secret with DIDIT_ENVIRONMENT=live in production, and add the production release condition to the flag. A host must not be switched from sandbox to live while it holds sandbox approvals: they stop counting, but users.identityVerifiedAt is only recomputed when a session of that user next changes. Production should start on live.