Skip to main content
Aadhaar OKYC is a two-call flow. The first call sends an OTP to the mobile number registered with the Aadhaar and returns a session_id. The second call submits the OTP the holder received.
Only send an OTP for an Aadhaar the holder has given you consent for. The OTP goes to a real person’s phone.
1

Set your credentials

Use https://dev.idto.ai (staging) while you build and https://prod.idto.ai (production) when you go live. Keep the client ID and API key on your server only. Never ship them to a browser or a mobile app.
.env
2

Send the OTP

A successful send returns 200 with data.session_id. Keep it with the user’s record.
200
3

Submit the OTP

Call submitOtp(sessionId, otp) with the OTP the holder types in. A verified result returns error_code: null and the Aadhaar details in data.

Test it

The sample Aadhaar 999999990019 is a placeholder. It passes idto’s format check, so the call reaches a source, and the result depends on which source serves your account. No OTP is sent to anyone in either case. A source that rejects the number answers like this, and nothing is billed:
400 Rejected by the source, not billed
A source that finds no Aadhaar record answers 200 with error_code: "IDTO_202" and data: null, and that call is billed. sendOtp returns the HTTP status and error_code for both, so branch on error_code.

Good to know

  • user_consent must be true, or the call returns IDTO_005.
  • A malformed OTP is rejected with IDTO_001 before it is checked.
Was this page helpful? Email us at tech@idto.ai with the page link.
Last modified on October 4, 2026