IDV Session — Integration Overview
This guide explains the full lifecycle of an Identity Verification (IDV) Session in Ralio, from creation through the final KYC state change that unlocks account creation.What is an IDV Session?
An IDV (Identity Verification) Session is a single, time-limited verification attempt for a given user. When created, Ralio returns ahostedUrl — a ready-to-use verification page that you share with your end user. There is no redirect URL configuration; instead, your backend receives real-time updates via webhooks as the session progresses.
Each session has a 7-day expiry window. If the user does not complete verification within that period, the session expires and a new one must be created.
Prerequisites
Before creating an IDV Session you must have:- A valid API key with the appropriate permissions (see Authentication docs)
- A registered user in the system (you will need their
uid) - A webhook endpoint configured in the Ralio Management Portal that subscribes to KYC events
Step 1 — Create an IDV Session
Call the endpoint below to initiate a new verification session for a user. Endpoint
Important: Store the id (session ID) in your system. You will use it to correlate the incoming webhook events with the correct user and session.
Step 2 — Share the Hosted URL with the User
ThehostedUrl returned in the response is the verification page for the end user. Direct the user to this URL through your product — for example, as a button in your onboarding flow or a link sent via email/SMS.
There is no configurable redirect URL. Once the user completes the verification flow on the hosted page, your system will be notified exclusively through webhook events.
The session URL remains valid for 7 days from creation. After that, it expires and you must create a new session.
Step 3 — Listen for Webhook Events
Configure your webhook endpoint to handle the following KYC events. Relevant events for IDV Sessions:| Event | Trigger |
|---|---|
kyc_session_verified | Session successfully verified |
kyc_session_manual_review | Session sent to manual compliance review |
kyc_session_failed | Session rejected |
kyc_session_expired | Session expired before completion |
kyc_state_updated | User’s KYC level changed (LIGHT → REGULAR) |
Session States Reference
An IDV Session moves through the following states during its lifecycle:| State | Code | Description |
|---|---|---|
NOT_STARTED | 1 | Session created, verification not yet begun |
STARTED | 2 | User has opened the hosted URL and is verifying |
VERIFIED | 3 | All checks passed — session approved |
REVIEW | 4 | Automatic checks inconclusive; sent to manual review |
REJECTED | 5 | Session failed — one or more checks refused |
EXPIRED | 6 | Session expired before the user completed verification |
Outcome Paths
Approved — kyc_session_verified
All verification checks passed. The session state transitions to VERIFIED.
Webhook payload:
kyc_state_updated event before unlocking account creation for the user.
Manual Review — kyc_session_manual_review
Automatic checks could not conclusively verify the user. The session state transitions to REVIEW and is assigned to a compliance officer for manual inspection.
Webhook payload:
kyc_session_verified or kyc_session_failed event.
Rejected — kyc_session_failed
One or more checks failed. The session state transitions to FAILED. The webhook payload includes a checks array with structured failure reasons.
Webhook payload:
Error CODES
| Error Code | Cause (why it fails) | Merchant action (proposed solution) |
|---|---|---|
KYC.IMG.LIGHT_EXCESS | Facial capture is overexposed (too much light). | Create a new KYC session and ask the user to retry in uniform lighting, without backlighting. |
KYC.IMG.LIGHT_LOW | Insufficient lighting / high noise in the selfie. | Create a new KYC session; instruct the user to use a front-facing light source. |
KYC.IMG.FRAME_FACE_CUT | Face was cut off or out of frame. | Create a new KYC session; ask the user to frame their full face. |
KYC.IMG.LIVENESS_HEAD_CIRCLES_MISSED | User did not complete the liveness gesture (e.g., head circles). | Create a new KYC session; emphasise following the on-screen instructions. |
KYC.IMG.GENERAL | Generic capture error (blurry, motion blur, etc.). | Create a new KYC session; resend the correct capture checklist. |
KYC.DOC.EXPIRED | Identity document is expired. | Create a new KYC session; request a valid, non-expired document. |
KYC.DOC.MISSING_EXPIRY | Expiry date is not visible in the document photo. | Create a new KYC session; ask for photos where the expiry date is clearly readable. |
KYC.DOC.ONE_SIDE_ONLY | Only one side of the document was submitted. | Create a new KYC session; require both sides of the document. |
KYC.DOC.CROPPED | Document is cropped or incomplete in the photo. | Create a new KYC session; ask for a full recapture. |
KYC.DOC.DETERIORATED | Document is deteriorated or illegible (stains, tears). | Create a new KYC session; request another document in good condition. |
KYC.DOC.INVALID_TYPE | Document type is not valid for the country or policy. | Create a new KYC session; instruct the user to use an accepted type (national ID, passport, etc.). |
KYC.DOC.DRIVER_LICENSE_NOT_ACCEPTED | Driver’s license is not accepted. | Create a new KYC session; request a passport or national identity document. |
KYC.DOC.GENERAL | Generic document error. | Create a new KYC session; send capture guidelines (sharpness, no glare). |
KYC.MISMATCH.NAME | The name extracted by KYC does not match the name on the created User. | Correct the User’s data to match exactly (normalise accents and name order). If the kycSession is VALIDATED and the provider allows binding → reuse the session; otherwise → create a new session. |
KYC.MISMATCH.SURNAME | Surnames do not match (User vs. KYC). | Same as above: update the User and reuse if possible; otherwise, create a new session. |
KYC.MISMATCH.DOB | Date of birth does not match. | Update the User; reuse only if VALIDATED and binding is allowed; otherwise, create a new session. |
KYC.MISMATCH.NATIONALITY | Nationality on the document differs from the User’s nationality. | Update the User (or review the country/document) and reuse if applicable; otherwise, create a new session. |
KYC.MISMATCH.COUNTRY_SELECTED | Country selected by the user differs from the document’s country. | Update the User/country to align; reuse if VALIDATED, otherwise create a new session. |
KYC.MISMATCH.BUSINESS_REPRESENTATIVE | Legal representative data does not match the KYC information. | Update the representative’s data and reuse if VALIDATED; otherwise, create a new session. |
KYC.SYS.UNDERAGE | User is a minor according to the document. | Close the case: mark as REJECTED. No recovery path available. |
KYC.SYS.PROVIDER_ERROR | KYC provider error or timeout. | Automatic retry with backoff. If it persists, open a support ticket. |
KYC.SYS.GENERAL | Generic system error not attributable to the user. | Retry; if it continues, contact support and include the correlationId for traceability. |
code and message fields to surface a meaningful error message to the user so they understand what went wrong.
Expired — kyc_session_expired
The session was not completed within the 7-day window. The session state transitions to EXPIRED.
What to do: Create a new IDV Session and share the new hostedUrl with the user.
KYC Level & Account Creation
Ralio maintains an overall KYC Level for each user, independently of individual sessions. The two levels are:| Level | Code | Description |
|---|---|---|
LIGHT | 2 | Basic verification — default initial state |
REGULAR | 1 | Full KYC completed |
LIGHT to REGULAR and fires a kyc_state_updated event:
Account creation is only permitted when the user’s KYC level isREGULAR. Do not attempt to create an account based on thekyc_session_verifiedevent alone — wait forkyc_state_updatedwithstate: "REGULAR".
Full Webhook Event Reference
| Event | Session State | Action Required |
|---|---|---|
kyc_session_verified | VERIFIED | Wait for kyc_state_updated → REGULAR |
kyc_session_manual_review | REVIEW | Notify user; await compliance decision |
kyc_session_failed | REJECTED | Read error codes; create a new IDV Session |
kyc_session_expired | EXPIRED | Create a new IDV Session |
kyc_state_updated | — | If state = REGULAR, unlock account creation |