Skip to main content
POST
Start DigiLocker session

Authorizations

x-api-key
string
header
required

Your API key for authentication. Use sandbox-with-json-responses as Sandbox key.

Body

application/json

Explicit end-user consent. Must be true to proceed (regulatory requirement under DPDP / RBI). Captured for audit.

Example:

true

Specific purpose for which consent is taken (min 20 chars). Stored in the session and returned as a consent receipt.

Minimum string length: 20
Example:

"KYC for loan account opening"

redirect_url
string<uri>
required

Where to redirect the user after consent. Must be a valid http/https URL.

Example:

"https://yourapp.com/digilocker/callback"

state
string

Opaque value echoed back to your redirect_url unchanged.

Example:

"investor_42"

documents
enum<string>[]

Identities to verify and return in the response.

Available options:
aadhaar,
pan,
driving_licence,
email,
mobile
Example:
user_flow
enum<string>

Use "signin" for users with an existing DigiLocker account, "signup" for account-on-the-fly.

Available options:
signin,
signup
Example:

"signin"

prefill_mobile
string

Pre-verified mobile to skip the signup OTP step (only applies with user_flow=signup).

Example:

"9999999999"

Response

Session started; redirect the user to authorization_url

status
string
Example:

"success"

session_id
string

The single identifier for this verification. Use it as the path parameter in POST /v1/kyc/digilocker/result/{session_id} to retrieve identity + documents.

Example:

"3f9a2c1e8b7d4e6fa1c2d3e4f5a6b7c8"

authorization_url
string

DigiLocker consent URL to redirect the investor to.

expires_in
integer

Seconds the authorization_url is valid for.

Example:

600