AmpleTrails, Gurugram · since 2012 +91 93154 41053 WhatsApp info@ampletrails.com Developer guide · Guides
Products
Identity verificationBusiness verification (KYB)Bank, income & creditFace match & OCRVideo KYC, eSign & flowsCompliance & riskPayouts & messagingAll 52 APIs
Use cases
Customer onboarding (KYC)Merchant & seller onboarding (KYB)Vendor & supplier verificationEmployee background checksGig and field worker onboardingLoan underwritingPayout and refund validationDuplicate and synthetic identity detection
Industries
Fintech & Digital LendingBanks & NBFCsInsuranceBroking, Mutual Funds & WealthCrypto & VDA PlatformsReal-money GamingE-commerce & MarketplacesStaffing, Gig & HRTelecomMobility & LogisticsReal Estate & RentalsB2B & Procurement
Resources
GuidesGlossaryFAQSecurity & data
DevelopersPricingAbout
Theme
Get API keysCall +91 93154 41053

DigiLocker API & SDK

You create a session and send the user to DigiLocker. They log in, pick what to share, and you receive the issued documents (signed files plus parsed fields) by API or webhook.

Identity document · sample NameRAVI KUMAR NumberABCDE1234F Matches the record Name match96 / 100 PAN statusOperative Aadhaar linkLinked
Source
DigiLocker (MeitY), issued documents pulled from the issuing department
Turnaround
As fast as the user: usually one to two minutes from link to documents
Endpoint
POST /v1/digilocker/session
Who can use it
Businesses onboarded as DigiLocker requesters, which we handle through our partner arrangement. The user must consent inside DigiLocker.

Overview

DigiLocker gives you original documents from the department that issued them, not a photo of a card. For most private companies it is the cleanest way to get Aadhaar details with full name and address. The user logs in, ticks what to share, and the signed documents come back to you.

Good to know

Only documents the issuing department has pushed to DigiLocker are available. Users without an Aadhaar-linked mobile may struggle to log in.

What you get

  • Issued, signed documentsAadhaar, PAN, DL and others come with the issuer's signature, so tampering shows.
  • Hosted consent screenThe user consents on DigiLocker's own pages; you don't build any of the login or OTP UI.
  • Parsed fieldsWe parse names, dates and addresses from the documents so you don't need your own parser.
  • Webhook on completionYou get a callback when the user finishes, so your flow doesn't have to poll.

Request

POST https://api.ampletrails.com/v1/digilocker/session

FieldTypeStatusDescription
redirect_urlstringRequiredWhere to send the user after they finish the DigiLocker consent flow
documentsarrayOptionalDocument types to request, such as AADHAAR, PAN or DRIVING_LICENSE
reference_idstringOptionalYour own reference for this user or session

Response

Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.

FieldMeaningExample
session_idID of the DigiLocker sessiondl_sess_7c1e2a
auth_urlHosted URL where the user logs in and gives consenthttps://digilocker.example/auth?s=...
statusSession status: CREATED, CONSENTED, COMPLETED or EXPIREDCOMPLETED
documents[].typeType of each fetched documentAADHAAR
documents[].issuerIssuing departmentUIDAI
documents[].dataParsed fields from the document, such as name, DOB and address{"name": "Ravi Kumar"}
documents[].file_urlShort-lived link to download the signed document (PDF/XML)https://files.example/abc.pdf

Example

curl -X POST https://api.ampletrails.com/v1/digilocker/session \
  -H "Authorization: Bearer $AMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"redirect_url": "https://yourapp.com/kyc/done", "documents": ["AADHAAR", "PAN"], "reference_id": "user_10293", "consent": "Y"}'
Response · 200 OK
{
  "status": "success",
  "request_id": "req_7f3a9c21e4",
  "data": {
    "session_id": "dl_sess_7c1e2a",
    "auth_url": "https://digilocker.example/auth?s=...",
    "status": "COMPLETED",
    "documents": {
      "type": "AADHAAR",
      "issuer": "UIDAI",
      "data": {
        "name": "Ravi Kumar"
      },
      "file_url": "https://files.example/abc.pdf"
    }
  }
}

Example data. The exact field list for your account comes with your sandbox documentation.

Use cases

KYC for non-regulated fintechs

The main Aadhaar route for companies that can't use OTP eKYC.

Education and hiring

Pull marksheets and certificates where boards and universities issue to DigiLocker.

Broking account opening

Fetch Aadhaar and PAN together in one consented step.

Questions about this API

Is DigiLocker Aadhaar accepted for KYC?

For many regulated entities, yes, as officially valid evidence, since it comes signed from UIDAI. Check with your compliance team for your specific regulator.

What if the user doesn't have a DigiLocker account?

They can create one in the same flow with their Aadhaar-linked mobile. It takes a minute or two.

How long can I download the files?

The file links we return are short-lived. Download and store what you need, masked where required, as soon as you get the webhook.

Does it work on mobile apps?

Yes. Open the auth_url in a browser tab or in-app browser and catch the redirect when it comes back.

Try the DigiLocker API & SDK API

Sandbox keys, the full field reference and a Postman collection, usually within a working day.