In short
- Log in by ABHA address, mobile or Aadhaar, each with an OTP.
- Every route ends with
skip_stateset toabha_endand the patient’soid. - Each call takes the
txn_idfrom the most recent response.
When to use this
The patient already has an ABHA and can identify it by one of: their ABHA address, their Aadhaar number, or a mobile number. They authenticate with an OTP. All three routes end withskip_state set to abha_end and give you the patient’s oid.
Pick the route from what the patient can offer:
- ABHA address (
shyam@abdm): two calls, init and verify. - Mobile number: init, verify, then pick one of the ABHA addresses on that mobile.
- Aadhaar number: init, verify, then auto-login into one of the ABHA addresses on that Aadhaar.
Before you start
- A client access token, sent as a Bearer token on every call. See Client login.
- Your facility onboarded as a Health Information Provider (HIP).
- In hand: the patient’s ABHA address, Aadhaar number or mobile number, and access to the phone that receives the OTP.
Sequence
Steps
1
Check the login methods (ABHA address route)
Send
abha_address to Search Auth Methods. The response carries auth_methods and blocked_methods. Offer the patient only methods in auth_methods. 2
Search by mobile (search route, optional)
Send
mobile to Search. It returns KYC-verified ABHA profiles on that mobile in profiles, each with an index and abha_address, plus a txn_id. The patient picks one. Pass its index as identifier and the txn_id to the next step with method set to search. 3
Send the OTP
Send
method, identifier and otp_system to Generate OTP:- ABHA address route:
methodisphr_address,identifieris the ABHA address. - Mobile route:
methodismobile,identifieris the mobile number. - Aadhaar route:
methodisaadhaar_number,identifieris the Aadhaar number. methodalso acceptsabha_number.
otp_system is abdm or aadhaar. The response carries txn_id and a hint. Keep txn_id; every later call takes the txn_id from the most recent response.4
Verify the OTP
Send
txn_id and otp to Verify OTP. The response carries skip_state, abha_profiles, profile, eka.oid and a new txn_id. Branch on the route and skip_state:- ABHA address route:
skip_stateisabha_end. Login is complete. Stop here. - Mobile route:
abha_profileslists the ABHA addresses on the mobile. The patient picks one. Go to “Complete the mobile login”. - Aadhaar route:
skip_stateisabha_create. Ifabha_profilesis non-empty, the patient picks one and you go to “Complete the Aadhaar login”. If it is empty, the patient has no ABHA address on this Aadhaar; create one.
5
Complete the mobile login
Send
txn_id and the chosen address as phr_address to Login. The response carries skip_state set to abha_end, profile and eka.oid.6
Complete the Aadhaar login
Send
txn_id and the chosen abha_address to Auto Login. The response carries skip_state set to abha_end, profile, eka.oid, token and refresh_token.State you must persist
When it fails
Error responses carrycode, error and source_error. source_error.code holds codes such as MIS-1013. See Error codes.
Test it
The testing page has the sandbox base URL, credentials and the happy path for every journey. Use an ABHA you created on sandbox through one of the create workflows.- ABHA address route: Search Auth Methods, Generate OTP with
phr_address, Verify OTP returnsabha_endandeka.oid. - Mobile route: Generate OTP with
mobile, Verify OTP, Login with one address fromabha_profilesreturnsabha_end. - Aadhaar route: Generate OTP with
aadhaar_number, Verify OTP returnsabha_createwith a non-emptyabha_profiles, Auto Login returnsabha_end. - The
eka.oidfrom login equals the one stored when the ABHA was created. - Wrong OTP once:
MIS-1013. Record the code you receive; the expected code is not confirmed. - Unknown ABHA address on Search Auth Methods: an error from the failure table.

