1. Home
  2. APIs
  3. Identity

DigiLocker document fetch API

Pull issued documents straight from the user’s DigiLocker.

Mode: Redirect + webhook
Checked against: DigiLocker (MeitY)

Overview

The customer logs in to DigiLocker and approves access. You receive the original issued document (Aadhaar, PAN, DL, marksheets and more) as signed XML or PDF, so there is nothing to fake.

POST/v1/digilocker/session

Where it’s used

  • Paperless onboarding
  • Education and certificate checks
  • Insurance and lending KYC

How the check runs

  1. You create a session with the documents you want and a redirect URL.
  2. We return a hosted link. Open it in a browser or web view.
  3. The user logs in to DigiLocker with their Aadhaar or mobile and approves sharing the selected documents.
  4. They are redirected back to your app, and we post the result to your webhook.
  5. Fetch the documents and parsed fields with the session ID.

Request

FieldDescription
redirect_urlWhere to send the user after consent
documentsList, e.g. ["AADHAAR","PAN"]
consent"Y" once your user has agreed to the check. Required for any check on a person.
curl -X POST https://api.yetlix.com/v1/digilocker/session \
  -H "x-client-id: $YETLIX_CLIENT_ID" \
  -H "x-client-secret: $YETLIX_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"redirect_url":"https://app.example.com/kyc/done","documents":["AADHAAR","PAN"],"consent":"Y"}'

Response fields

Inside the data object. The envelope (status, request_id, billable, timestamp) is the same for every API and is described in the docs.

FieldTypeMeaning
session_idstringUse it to fetch results or match the webhook.
urlstringHosted DigiLocker consent link.
expires_inintegerSeconds until the link expires.
documents[].typestringAADHAAR, PAN, DRIVING_LICENCE, etc. (in the result)
documents[].issuerstringIssuing authority as recorded by DigiLocker.
documents[].fieldsobjectParsed fields for that document type.
documents[].filestringSigned XML or PDF, base64.

Outcomes and what to do

Every check can end in a handful of ways. Decide up front what your product does in each case, so nothing falls through to a support ticket.

COMPLETED

User shared all requested documents.

Do this: Use the parsed fields; store the signed file as KYC evidence.

PARTIAL

Some documents were not in the user’s locker.

Do this: Ask for the missing ones another way.

DENIED / EXPIRED

User declined or didn’t finish.

Do this: Offer a retry or another path.

Sandbox test values

Send these values in redirect_url with your sandbox key to get each result. Anything else returns INVALID_INPUT in sandbox.

ValueReturns
https://app.example.com/kyc/doneSession created

Run these in the playground

Best practices

  • Issued documents can’t be faked, which makes DigiLocker the strongest option for paperless KYC when users have the documents in their locker.
  • Always handle the webhook. Users often close the tab before the redirect happens.

Compliance note. Documents issued to a user’s DigiLocker account are treated as equivalent to originals under the IT (Preservation and Retention of Information by Intermediaries Providing Digital Locker Facilities) Rules, 2016, and regulators accept them as e-documents for KYC.

Frequently asked

What if the user has no DigiLocker account?

They can create one inside the flow using Aadhaar and mobile OTP; it takes about a minute.

Can I fetch marksheets or degrees?

Yes, where the board or university issues to DigiLocker. Tell us which issuers you need.

Often used with