Start DigiLocker session
Start a DigiLocker session to fetch the investor’s government-issued documents (Aadhaar, PAN, etc.) with their consent.
How it works:
- Call this endpoint — you get back an
authorization_urland asession_id. Thesession_idis the single identifier you use for everything else. - Redirect the investor to
authorization_urlto log in to DigiLocker and grant consent. - After consent, the investor is redirected back to your
redirect_urlwith query parameters appended (see the table below). - Use the
session_id(path parameter) on thePOST /v1/kyc/digilocker/result/{session_id}endpoint to read the consented data — identity, documents, and parsed document content.
Redirect parameters appended to your redirect_url:
| Outcome | Appended query parameters |
|---|---|
| Consent granted | ?success=true&id={session_id}&state={state}&documents=pan+driving_licence&has_verified_data=1 |
| Partial consent (e.g. PAN only) | ?success=true&id={session_id}&state={state}&documents=pan |
| Consent denied / failed | ?success=false&id={session_id}&state={state}&error={error} |
documents lists the documents the investor agreed to share;
has_verified_data=1 appears only when verified identity is available.
Credits: Free. Billing happens when documents/identity are returned.
Authorizations
Your API key for authentication.
Use sandbox-with-json-responses as Sandbox key.
Body
Explicit end-user consent. Must be true to proceed
(regulatory requirement under DPDP / RBI). Captured for audit.
true
Specific purpose for which consent is taken (min 20 chars). Stored in the session and returned as a consent receipt.
20"KYC for loan account opening"
Where to redirect the user after consent. Must be a valid http/https URL.
"https://yourapp.com/digilocker/callback"
Opaque value echoed back to your redirect_url unchanged.
"investor_42"
Identities to verify and return in the response.
aadhaar, pan, driving_licence, email, mobile Use "signin" for users with an existing DigiLocker account, "signup" for account-on-the-fly.
signin, signup "signin"
Pre-verified mobile to skip the signup OTP step (only applies with user_flow=signup).
"9999999999"
Response
Session started; redirect the user to authorization_url
"success"
The single identifier for this verification. Use it as the
path parameter in POST /v1/kyc/digilocker/result/{session_id}
to retrieve identity + documents.
"3f9a2c1e8b7d4e6fa1c2d3e4f5a6b7c8"
DigiLocker consent URL to redirect the investor to.
Seconds the authorization_url is valid for.
600

