Skip to main content
DigiLocker lets a user share government-issued records with you after they consent on the DigiLocker screen. idto hosts the consent step and the token exchange, so your server only makes five calls, all with your X-Client-ID and X-API-Key. These are v1 endpoints: responses use the v1 shape, there is no Idempotency-Key support, and billing is signalled by chargeble. See Migrate from v1.
1

Optional: check the user has a DigiLocker account

result.registered is true with code 1004 when the mobile number has an account, and false with code 2002 when it does not. Both come back with status: "success". If there is no account, set redirect_to_signup: true in the next step so the user can create one.
2

Start a session

Redirect the user’s browser to url. idto generates the PKCE pair for the DigiLocker authorisation and hands the verifier back to you on the callback.
3

Handle the callback

After consent the user returns to your redirect_url with four query parameters:Check state matches the user you started the session for, then exchange the code straight away: it is single-use and short-lived.
4

Exchange the code for a reference key

The reference_key is valid for one hour. Use it for every call that follows.
5

Read the user's details

The response carries a user object with name, dob, gender, mobile, email, digilockerid, eaadhaar and picture, plus reference_key.
6

Fetch the Aadhaar record

On success the response body is the document itself, with its Content-Type, not JSON. Save it as a file.

Inside a verification session

user_details and fetch_aadhaar accept an optional workflow_session_token. Pass it when this step runs inside a KYC workflow session so the step is charged once, by the session.

Alternative: the v2 exchange

If you already hold a code and code_verifier, POST /v2/verify/digilocker exchanges them and returns the identity in the v2 envelope with IDTO_* codes. See the DigiLocker reference.

Endpoint reference

Was this page helpful? Email us at tech@idto.ai with the page link.
Last modified on October 4, 2026