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

Aadhaar OTP eKYC API

A two-step API. Step one sends an OTP to the mobile linked with the user's Aadhaar, step two submits that OTP and returns the eKYC record: name, DOB, gender, address and photo.

Identity document · sample NameRAVI KUMAR NumberABCDE1234F Matches the record Name match96 / 100 PAN statusOperative Aadhaar linkLinked
Source
UIDAI eKYC service, via a licensed KUA/AUA arrangement
Turnaround
Real time once the user enters the OTP; the OTP itself usually arrives within a minute
Endpoint
POST /v1/aadhaar/ekyc/otp
Who can use it
Only for entities allowed to use Aadhaar authentication under the Aadhaar Act and its 2019 amendment, such as banks, NBFCs, insurers and others notified by the government.

Overview

The standard Aadhaar eKYC flow most regulated lenders and insurers use. The user enters their Aadhaar number, receives an OTP from UIDAI, and types it into your app. You get their demographic details and photo straight from UIDAI, with the consent tied to that transaction.

Good to know

If the user's mobile is not linked to Aadhaar, the OTP never arrives and the flow cannot finish. Offer DigiLocker or offline Aadhaar as a fallback.

What you get

  • Data straight from UIDAIName, DOB and address come from the source record, not from an uploaded card that could have been edited.
  • Photo for face matchThe eKYC photo can go straight into a face match against the user's selfie.
  • Two calls, clear statesGenerate OTP, then submit OTP. Each step has its own error codes for wrong OTP, expired OTP and too many attempts.
  • Consent tied to the callEach request carries the consent text the user saw, so your audit file shows exactly what they agreed to.

Request

POST https://api.ampletrails.com/v1/aadhaar/ekyc/otp

FieldTypeStatusDescription
id_numberstringRequired12-digit Aadhaar number (step 1: generate OTP)
consentstringRequiredY if the user has given explicit consent
request_idstringRequiredReference returned by the OTP generation step (step 2: submit OTP)
otpstringRequired6-digit OTP the user received on their Aadhaar-linked mobile

Response

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

FieldMeaningExample
full_nameName as per AadhaarRavi Kumar
dobDate of birth1990-04-12
genderGender: M, F or TM
address.lineHouse, street and localityH.No. 12, Sector 15
address.districtDistrictGurugram
address.stateStateHaryana
address.pincodePIN code122001
photo_base64Photograph on the Aadhaar record, base64 encoded/9j/4AAQSkZJRg...
masked_aadhaarAadhaar number with the first 8 digits maskedXXXXXXXX4321
otp_verifiedWhether the OTP verification succeededtrue

Example

curl -X POST https://api.ampletrails.com/v1/aadhaar/ekyc/otp \
  -H "Authorization: Bearer $AMPLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id_number": "XXXXXXXX4321", "consent": "Y", "request_id": "ekyc_8f2a1c", "otp": "123456"}'
Response · 200 OK
{
  "status": "success",
  "request_id": "req_7f3a9c21e4",
  "data": {
    "full_name": "Ravi Kumar",
    "dob": "1990-04-12",
    "gender": "M",
    "address": {
      "line": "H.No. 12, Sector 15",
      "district": "Gurugram",
      "state": "Haryana",
      "pincode": "122001"
    },
    "photo_base64": "/9j/4AAQSkZJRg...",
    "masked_aadhaar": "XXXXXXXX4321",
    "otp_verified": true
  }
}

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

Use cases

NBFC and bank onboarding

Fills the KYC form for the customer and gives you the photo for the face match, in under two minutes.

Insurance proposals

Insurers fill proposer details from eKYC instead of typing them in from a photocopy.

Account re-KYC

Existing customers whose KYC is due can refresh it from their phone without visiting a branch.

Questions about this API

Can any company use Aadhaar OTP eKYC?

No. After the 2018 Supreme Court ruling and the 2019 amendment, only entities permitted by law or notified by the government can do Aadhaar authentication. If you're not one, use DigiLocker or offline Aadhaar instead and we'll help you set that up.

How long is the OTP valid?

A few minutes. If the user takes longer, call the generate step again. We return a clear OTP_EXPIRED error so your app can show a resend button.

Do we get the full Aadhaar number back?

No. You get it masked (last four digits). That is what you should store anyway.

What happens after three wrong OTPs?

UIDAI blocks further attempts for that number for a while. Show the user a clear message and offer another route such as DigiLocker rather than letting them keep trying.

Try the Aadhaar OTP eKYC API

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