Menu
API integration
Testing every branch
Run each case with your sandbox key before going live. sandbox_outcome sets the decision while the real checks still run (any document photo works), so you can test your webhook handling without real IDs.
| CASE | HOW | EXPECT |
|---|---|---|
| Approved | "sandbox_outcome": "approved", complete the flow | session.approved, status approved |
| Declined | "sandbox_outcome": "declined" | session.rejected, status declined (no retry) |
| In review → decision | "sandbox_outcome": "review", then approve or decline it in Panel → Review queue | session.manual_review, then session.approved / session.rejected |
| Retry | No sandbox_outcome; upload a photo with no document on it | document.rejected with status in_progress; /result shows hint and retries_left |
| Resubmission | A review session → Panel → session → Request resubmission | session.resubmitted; your backend sends a new sdk-link |
| Expired | Create a session and leave it unopened for 60 min | session.expired, status expired |
| Late user | Open the link after 15 min | "Expired" on screen, no session.failed, 401 token.expired; your backend issues sdk-link |
| Idempotency | Send POST /v1/sessions twice with the same Idempotency-Key | The same session_id both times |
| Duplicate webhook | Process the same event_id twice | Your handler acts once |
| Bad signature | POST /v1/webhooks/test, then change one byte of the body before verifying | Your handler rejects it |
Why a test session goes to review
Without sandbox_outcome the real checks decide, and these send a session to review even when every photo is fine:
- The same face under another
applicant_external_id(duplicate_face): testing several users with your own face. - The same
applicant_external_idwith another person or date of birth (identity_changed). - The document and the selfie uploaded from different devices or browsers (
device_changed). - US and Canadian documents (their barcode is not signed), a document from another country than the one chosen, or an
expected_identitythat does not match. - Your own rules:
minimum_age,risk_review_level.
Sessions created in the panel (Sessions → New session) follow the same rules and send the same webhooks. Sandbox webhooks go to sandbox_webhook_url if you set one (Panel → My profile). Then work through Going live.