Skip to main content

In short

  • Cache the profile, QR code and card; evict them after an update or KYC.
  • Update Profile must send every field Profile Details returned.
  • After KYC, check that kyc_verified is true and abha_number is set.

When to use this

The patient has an ABHA and is logged in. Use this workflow to:
  • show their ABHA profile, card and QR code
  • correct their details
  • run KYC on an ABHA address that was created with a mobile OTP.
Deleting the profile is also here; it is irreversible. These calls are independent. Run the ones your screen needs, in any order, except that KYC is a sequence of init then verify.

Before you start

  • A client access token, sent as a Bearer token on every call. See Client login.
  • The patient’s oid, stored when the ABHA was created or the patient logged in. Every call here except Search takes it in the X-Pt-Id header or the oid query parameter.
  • A live ABHA Gateway session for the patient. Check it first with Hold the ABHA Gateway session; a 491 means the session has expired.
  • For KYC: the patient’s 14-digit ABHA number or 12-digit Aadhaar number, and access to the phone that receives the OTP.

Sequence

Steps

1

Fetch the profile

Call Profile Details. The response carries the patient’s abha_address, abha_number and kyc_verified, with the other profile fields listed on the reference page.Cache the response on your side. Do not call it on every page load. Evict the cache when the profile is updated.
2

Show the QR code

Call ABHA QR Code. The response is JSON with no fixed structure; it varies with how the ABHA was created. Generate the QR code from the whole response body rather than from named fields. Cache it and evict it when the profile is updated.
3

Show the ABHA card

Call ABHA card. The response is the card as a PNG image (image/png). Cache it and evict it when the profile is updated.
4

Update the profile

Send the profile to Update Profile. The request must include every field that Profile Details returned, not only the changed ones. A successful update returns 204 with no body. Evict your cached profile, QR code and card.For a KYC-verified ABHA, name, gender and date of birth cannot be changed.
5

Start KYC (only if kyc_verified is not true)

Send method and identifier to Kyc Init. method is abha-number with the 14-digit ABHA number as identifier, or aadhaar with the 12-digit Aadhaar number. The request also takes user_x_token, the user authorization token. An OTP goes to the patient. The response carries txn_id. If the OTP does not arrive, send txn_id to Kyc Resend and use the txn_id it returns.
6

Verify KYC

Send txn_id, otp and user_x_token to Kyc Verify. The response carries txn_id. Fetch the profile again and check that kyc_verified is true and abha_number is set. Evict your cached QR code and card.
7

Delete the profile (only on the patient's request)

Call Delete Profile. It removes the profile and every associated document, vital record and related data from Eka, with no recovery. The ABHA metadata stays in the ABDM system, because ABDM offers no delete. A successful delete returns 204. Ask the patient to confirm before you call it, and clear the oid and cached assets from your patient record afterwards.

State you must persist

When it fails

Which of these codes each call returns is not yet confirmed. The codes come from the errors page, matched by meaning. Log the code you actually receive.
Error responses carry code, 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 a patient whose ABHA you created on sandbox and whose session is live.
  • Profile Details returns the abha_address you stored at creation.
  • ABHA QR Code returns JSON you can encode as a QR code; ABHA card returns an image.
  • Update Profile with every field from Profile Details and one changed value returns 204; Profile Details shows the change.
  • On a mobile-created address: Kyc Init, Kyc Verify, then Profile Details shows kyc_verified: true.
  • Wrong OTP on Kyc Verify: MIS-1013. Record the code you receive; the expected code is not confirmed.
  • Profile Details on an expired session returns 491.
  • Delete Profile on a throwaway sandbox ABHA returns 204; Profile Details for that oid then fails.