Aadhaar e-KYC (OTP) API
Verify Aadhaar with an OTP sent to the holder’s mobile.
Overview
A two-step flow. First call sends a one-time password to the mobile number linked with the Aadhaar. Second call submits that OTP and returns the holder’s name, date of birth, gender, address and photo. The Aadhaar number itself is never returned in full.
POST/v1/verify/aadhaar/otp then POST/v1/verify/aadhaar/submit
Where it’s used
- Digital account opening
- Gig worker and agent onboarding
- Address proof for deliveries and services
- SIM and connection KYC
How the check runs
- Step 1: you send the 12-digit Aadhaar number with consent. We send an OTP to the mobile number registered with UIDAI and return a ref_id.
- Your app shows an OTP box. The OTP is valid for about 10 minutes.
- Step 2: you send the ref_id and the OTP the user typed.
- We fetch the signed offline e-KYC data, verify UIDAI’s digital signature, and return parsed fields with the Aadhaar number masked.
- The full Aadhaar number is discarded after the call. Only the masked form is kept in logs.
Request
| Field | Description |
|---|---|
aadhaar_number | 12-digit Aadhaar (step 1) |
ref_id + otp | Reference from step 1 and the 6-digit OTP (step 2) |
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/verify/aadhaar/submit \
-H "x-client-id: $YETLIX_CLIENT_ID" \
-H "x-client-secret: $YETLIX_CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{"ref_id":"otp_8f2c1a9e","otp":"482915","consent":"Y"}'
{
"status": "success",
"request_id": "req_7Hq2kD91",
"data": {
"name": "Priya Sharma",
"dob": "14-08-1994",
"gender": "F",
"aadhaar_masked": "XXXX XXXX 4471",
"address": {
"house": "B-212",
"locality": "Sector 62",
"district": "Gautam Buddha Nagar",
"state": "Uttar Pradesh",
"pincode": "201309"
},
"photo": "/9j/4AAQSkZJRg…"
}
}
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.
| Field | Type | Meaning |
|---|---|---|
name | string | Name as per Aadhaar. |
dob | string | Date of birth, DD-MM-YYYY. Some records only have year of birth. |
gender | enum | M, F or T. |
aadhaar_masked | string | XXXX XXXX followed by the last four digits. |
address | object | house, street, locality, vtc, district, state, pincode, as split by UIDAI. |
care_of | string | S/O, D/O, W/O or C/O name, if present. |
photo | string | Base64 JPEG of the Aadhaar photo. Use it for face match. |
signature_valid | boolean | true when UIDAI’s signature on the e-KYC data checked out. Never accept data where this is false. |
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.
OTP_SENT
Step 1 succeeded.
Do this: Show the OTP input with a 10-minute timer and a resend after 60 seconds.
INVALID_OTP
The user typed the wrong OTP.
Do this: Let them retry. After 3 wrong attempts the ref_id is locked; start again from step 1.
OTP_EXPIRED
More than ~10 minutes passed.
Do this: Restart from step 1.
MOBILE_NOT_LINKED
No mobile number is registered with this Aadhaar.
Do this: Offer DigiLocker or an alternative ID; the user must update their mobile at an Aadhaar centre.
SUCCESS
Verified e-KYC data returned.
Do this: Run face match between the Aadhaar photo and a live selfie before approving.
Sandbox test values
Send these values in otp with your sandbox key to get each result. Anything else returns INVALID_INPUT in sandbox.
| Value | Returns |
|---|---|
482915 | Correct OTP, data returned |
000000 | Wrong OTP |
111111 | OTP expired |
Best practices
- Never store the full Aadhaar number in your own database. Store aadhaar_masked and the request_id.
- Pair with Face match and Liveness: OTP proves access to the phone, not that the phone’s owner is the person applying.
- Use the address object to pre-fill forms instead of asking the user to type it again.
- Show plain-language consent before step 1: what you’ll fetch, why, and that the user can choose another document.
Compliance note. Aadhaar-based verification is governed by the Aadhaar Act, 2016 and UIDAI regulations, and its use by financial entities is set out in each regulator’s KYC directions. Offline e-KYC must be voluntary, with explicit consent and an alternative offered. Talk to us about which Aadhaar flow your entity and use case can use.
Frequently asked
Why did my user not receive the OTP?
The OTP goes to the mobile registered with UIDAI, which is often an old number. Use the resend option after 60 seconds; if it still fails, offer DigiLocker or another ID.
Can I store the photo?
Yes, for as long as your KYC record-keeping rules require, protected like any other KYC document.
Is biometric authentication supported?
Not through this API. Biometric Aadhaar authentication needs a registered device and an authorised entity; we can advise on options.