In short
- Acknowledge
abha.hiu_data_pushwithin 5 seconds, then decrypt. - Decrypt each entry with your stored
private_keyandnonce. - Report each entry’s result with Push FHIR parsing status.
- If Eka stores the data for you, read the records from the records product instead.
When to use this
The patient has granted a consent you raised in Request a patient’s consent as a HIU, and you manage the data on your side. Each HIP encrypts the approved records with your public keyset and Eka delivers them to you on a webhook. This workflow decrypts them and tells Eka which care contexts you could parse. If Eka stores the data for you, nothing arrives on a webhook. Read each approved care context with Retrieve Health Records in the records product, passing thecare_context_id from Consent Details as the identifier. That call belongs to the records product and is documented there.
Before you start
- A bearer token for the API. See Authorization.
- Your public keyset registered, and the matching
private_keyandnoncestored on your side. See the keyset steps in Request a patient’s consent as a HIU. - A granted consent, with its
consent_idand the approvedcare_contexts[].id. - A webhook endpoint registered with Eka that verifies the
Eka-Webhook-Signatureheader. See Webhook signature. - A way to decrypt: either the Ecdh decrypt call, or the abdm-ecdh library in Go, Python or Java.
Sequence
Steps
1
Receive the push and acknowledge it
Eka sends
abha.hiu_data_push when a HIP pushes records for your consent. Verify the signature and reply 200 within 5 seconds; Eka retries on any other status. Decrypt after you reply, so the 5 seconds are not spent on decryption.From data, keep:consent_idandtransaction_id: you send both back in the acknowledge step. The webhook carries a top-leveltransaction_idand adata.transaction_id; which of the two fields on-push expects is not yet confirmed.
entries: one per care context, each withcare_context_id,content(the encrypted FHIR bundle),checksumandmedia(application/fhir+json).key_information: the sender’s key material, withdh_public_key.key_valueandnonce.hip_id,abha_addressandoid: which HIP and which patient the records belong to.
consent_id against the consents you raised.2
Decrypt each entry
Call Ecdh decrypt once per entry, or decrypt locally with the abdm-ecdh library. Map the fields like this:
key_information.dh_public_key is the HIP’s (sender’s) public key; your own key is the private key you registered with your keyset.The response carries decrypted_data, the FHIR bundle as plain text. Hash the decrypted bundle and compare the result with entries[].checksum: the checksum is computed over the plain-text FHIR data, not the encrypted content. Parse the bundle as JSON.3
Report the parsing status
Call Push FHIR parsing status with:
consent_id.- The
transaction_idfrom the webhook. Which of the two fields is not yet confirmed. - One
status_responseitem per entry, withcare_context_id,success(trueif you decrypted and parsed it), and adescriptionwhen it failed.
202 Accepted.State you must persist
When it fails
Error responses carrycode, error and source_error (code, message). Codes are listed on the errors page.
Test it
The testing page has the sandbox base URL, credentials and the happy path for every journey. Sandbox base URL:https://api.dev.eka.care.
- Run Request a patient’s consent as a HIU to a granted consent
-
abha.hiu_data_pusharrives; your endpoint replies200within 5 seconds - Each entry decrypts to a FHIR bundle with Ecdh decrypt and with the abdm-ecdh library, and both give the same result
- On-push with every entry
successtruereturns202 - Decrypt with a wrong private key; report that entry with
successfalse

