Skip to main content
POST
Generate Aadhaar OKYC OTP
Aadhaar OKYC verifies a person against their Aadhaar record with an OTP the holder receives on the mobile number linked to their Aadhaar. It takes two calls. This one sends the OTP and returns a session_id. The second, OKYC submit OTP, takes that session_id and the OTP and returns the holder’s name, date of birth, gender, address and photo. Make both calls with the same API credentials. Ask the holder to type the OTP into your app, then send it with step 2.

Environments

This call sends a real SMS to the holder in both environments. Only send it for an Aadhaar whose holder has asked to be verified.

How to read the result

  • status is success for every completed call. Branch on error_code, never on status.
  • error_code: null with data.session_id: the OTP was sent. Keep session_id for step 2.
  • error_code: "IDTO_202" with data: null: the Aadhaar number was rejected as invalid. This is a definitive answer and is billed.
  • billed is true for both outcomes above and false on every error.
  • user_consent must be true. Record the holder’s consent before you call.
Send an Idempotency-Key header (up to 255 characters). If a network error makes you retry with the same key and body, you get the first response back, no second SMS is sent and you are not charged again. See Idempotency.

Errors

IDTO_103 means OTP generation is blocked for this Aadhaar for now. Ask the holder to try again later, or offer DigiLocker or an Aadhaar upload instead. A missing or wrong X-Client-ID / X-API-Key pair returns 401 with a detail string and is not billed. The full code list is in v2 error codes.

Test scenarios

Input rules: aadhaar_number is exactly 12 digits and the first digit is 2 to 9, with no spaces or dashes. See Input formats, the Aadhaar FAQ and the send-OTP recipe. Was this page helpful? Email us at tech@idto.ai with the page link.

Authorizations

X-Client-ID
string
header
default:<client-id>
required

The Client ID shown on the API Credentials page of the idto dashboard. It is not your account or customer ID, which returns 401. Send it on every server-to-server request together with X-API-Key. Staging and production client IDs are different.

X-API-Key
string
header
default:<api-key>
required

Your API key from the idto dashboard (API credentials). Keep it on your server; never ship it in a browser or mobile app. Send it on every server-to-server request together with X-Client-ID.

Headers

Idempotency-Key
string

Make retries of this exact request safe. If the same key is replayed with an identical request body, the original result is returned without re-running the verification or billing again. If the same key is replayed with a different body, the request is rejected with IDTO_010 (422). Omitting this header runs every request as new.

Maximum string length: 255

Body

application/json
aadhaar_number
string
required

12 digits, first digit 2 to 9.

Pattern: ^[0-9]{12}$
Example:

"999999990019"

Must be true: the holder has consented to this verification.

Example:

true

user_id
string
Maximum string length: 255
workflow_session_token
string
Maximum string length: 64

Response

An OTP was sent (or the Aadhaar number was rejected as a definitive no-record).

status
enum<string>
required
Available options:
success
message
string
required
error_code
string | null
required

null on a full match, an IDTO_2xx code on a definitive no-record result. Both are billed.

data
object | null
required
billed
enum<boolean>
required
Available options:
true
tranx_id
string | null
timestamp
string<date-time> | null
Last modified on December 1, 2026