Skip to main content

Overview

The ABDM Records module is a plug-and-play UI widget that enables your application to request, track, and act on ABDM (Ayushman Bharat Digital Mission) health data consents on behalf of your patients. When a patient approves a consent request, their medical records are delivered to your backend automatically — your application is then responsible for displaying those records when the View button is clicked.

How It Works

1

Embed the widget

Load the ABDM Records widget inside your application by rendering it in an <iframe> or a dedicated route, passing required URL parameters.
2

Request consent

On click of Request Consent inside the widget, selects the date range, expiry, purpose, and record types, then submits the form.
3

Patient approves

The patient receives a notification on their ABHA-linked app and either grants or denies the request.
4

Records arrive in your backend

When the patient grants consent, Eka’s ABDM gateway delivers the medical records to your registered callback/backend endpoint.
5

Your app shows the records

The consent row in the table shows Success. When the View button is clicked, the widget opens your consent-view URL so your application can display the received records.

Integration

Embedding the widget

Render the widget inside an <iframe> (or directly in a React shell) and pass the required query parameters in the src URL.
<iframe
  src="https://abdm.eka.care/abdm-records/index.html?abha=USER_ABHA_ID&oid=PATIENT_OID&cid=CLINIC_ID&consent-view=https://yourapp.com/records&token=BEARER_TOKEN"
  width="100%"
  height="100%"
  frameborder="0"
/>

URL parameters

ParameterRequiredDescription
abhaYesPatient’s ABHA address (e.g. user@abdm)
oidYesPatient’s internal OID in your system
cidYesYour clinic / HIU identifier registered with ABDM
consent-viewYesBase URL of your application’s medical records page — the widget appends consent details as query params when the View button is clicked
tokenYesShort-lived Bearer token used to authenticate API calls to Eka’s backend
Tokens are short-lived. Generate a fresh token on each widget load from your backend and never expose long-lived credentials in the browser. Instead of route usage of iframe is preferred as it doesn’t expose the token in the URL bar and allows better control over token refresh and security.

Click the Request Consent button in the top-right corner of the widget header. A modal will open with the following fields:

Request modal fields

FieldDescriptionDefault
Request ToPatient’s ABHA address (pre-filled, read-only)From abha param
Records FromDate range of records to fetch — choose a preset (Last 3 / 6 / 12 months) or set a custom rangeLast 6 months to today
Shared Records Will Expire InHow long the granted consent stays valid6 months
Purpose (Advanced)Reason for requesting recordsCare management
Medical Record Type (Advanced)Types of records to includeAll types

Available record types

  • OPConsultation
  • Prescription
  • DischargeSummary
  • DiagnosticReport
  • ImmunizationRecord
  • HealthDocumentRecord
  • WellnessRecord

Available purposes

  • Care management
  • Public Health
  • Disease Specific Health Research
After filling in the details, click Request Medical Records. A confirmation screen appears:
“Your request for medical records has been sent. You can see the medical records once the patient approves your request.”
Click Check Request Status to return to the consent history table.
The widget’s main screen shows a table of all consent requests for the patient. Each row represents one consent and includes:
ColumnDescription
Consent IDUnique identifier for the consent
Requested OnDate the consent was requested
Last UpdatedDate the consent status last changed
Shared ForDate range of records covered by the consent
Expires InDays remaining before the consent expires
StatusCurrent state of the consent (see below)
ActionView button — only visible when status is Success

Each consent request transitions through a lifecycle. The table shows a color-coded status badge for each row.

Status reference

Status badgeInternal valueMeaning
🟢 SuccessGRANTEDThe patient approved the consent. Records have been delivered to your backend. The View action is now available.
🟡 PendingREQUESTEDThe consent request has been sent to the patient and is awaiting their decision.
🔴 DeniedDENIEDThe patient explicitly rejected the consent request.
🔴 RevokedREVOKEDThe patient previously granted consent but has since revoked it.
🔴 ExpiredEXPIREDThe consent was granted but the expiry period has passed.
Only Success consents have records associated with them. For all other statuses, no records will be available in your backend.

Viewing Records (Your Responsibility)

When a consent is in Success state, a View button appears in the Action column. Clicking it opens your consent-view URL in a new browser tab.

URL format your page will receive

The widget constructs the URL as:
{consent-view}?consent_id={consentId}&abha={abhaAddress}
Example:
https://yourapp.com/records?consent_id=abc-123-xyz&abha=user@abdm
The widget opens this URL in a new tab. If the browser blocks the popup, it falls back to navigating the current tab.

What your records page must do

1

Read URL params

Extract consent_id and abha from the query string.
2

Look up records in your backend

Use the consent_id to fetch the medical records your backend received from the ABDM gateway when the patient approved the consent.
3

Display the records

Render the records in your own UI. Eka delivers the raw FHIR bundles to your registered webhook — how you store and display them is entirely up to you.
The ABDM Records widget does not display the medical record content itself. It only manages the consent lifecycle. You are responsible for storing records from the ABDM gateway callback and building the records viewer page at consent-view.

API Reference

The widget communicates with Eka’s backend using the following endpoints. All requests include your token as a Bearer token in the Authorization header.
MethodEndpointPurpose
POST/abdm/v1/consents/listFetch the consent history for a patient
POST/abdm/v1/consents/createSubmit a new consent request
POST/abdm/v1/consents/detailsFetch details of a specific consent
Base URLs:
EnvironmentBase URL
Productionhttps://api.eka.care
Developmenthttps://api.dev.eka.care

Frequently Asked Questions

The View action only appears for consents with Success (GRANTED) status. Ensure the patient has approved the request and the table has refreshed.
OPConsultation, Prescription, DischargeSummary, DiagnosticReport, ImmunizationRecord, HealthDocumentRecord, and WellnessRecord. You can select one or more when requesting consent.