Ideal for: Cloud-hosted HMS installations with a publicly accessible domain/URL (e.g. https://hms.myhospital.com).
In this model, the Gateway functions asynchronously. When an event occurs (e.g., patient links a record or grants a consent), the bridge actively POSTs a signed HMAC payload to your HMS server.
- No Polling: No periodic API calls are required, preserving server CPU and network bandwidth.
- Real-time: Updates are delivered instantly as soon as ABDM processes them.
- Security: The HMS must verify the
X-Eka-Signatureheader using the shared webhook secret before processing.
Ideal for: On-premise HMS installations running inside local intranet networks behind NAT or firewalls.
Since the gateway cannot establish outbound network connections to local IPs behind NAT, the HMS pulls updates by periodically calling the gateway.
- Zero Network Config: No public IP, DNS records, or SSL domain setup is required on your local HMS server.
- NAT/Firewall Friendly: Fully secure since all connections originate outbound from the HMS.
- Endpoints: HMS polls
GET /api/v1/hiu/consent/status(for consent state) andGET /api/v1/hiu/data/fetch(for decrypted clinical data).
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| SYSTEM | |||
| GET | /api/v3/health?hfr_id=YOUR_HFR_ID | Gateway health & API key check — validates HFR ID and Bearer token together. Returns hfr_id_ok + api_key_ok. Use as HMS Test Connection. Both are required. | Bearer |
| GET | /api/v3/gateway/status | Gateway + ABDM upstream connectivity check | Bearer |
| GET | /api/v3/abdm/status | ABDM live status via direct session-token probe (/api/hiecm/gateway/v3/sessions) for HMS user alerts | Bearer |
| HEALTH RECORDS (HMS → Bridge → ABDM) | |||
| POST | /api/v1/patient/sync | Push or update patient master from HMS (ABHA optional). Upserts gateway patient registry and maps to authenticated hospital. | Bearer |
| POST | /api/v1/fhir/sync | HMS-friendly clinical sync endpoint. Accepts fhir_resource, auto-wraps to document bundle when required, then forwards to /api/v3/records/push. | Bearer |
| POST | /api/v3/records/push | Push a FHIR R4 health record from HMS. Validates bundle, stores in gateway, returns record_id + queue_id. Detects duplicates via care_context_reference. | Bearer |
| GET | /api/v3/records | List stored records (filterable by abha_id, status, record_type) | Bearer |
| GET | /api/v3/records/{id} | Get a single stored record including full record_data | Bearer |
| POST | /api/v3/records/{id}/share | Trigger ABDM care-context linking for a stored record (HIP-initiated share) | Bearer |
| POST | /api/v3/records/{id}/link-and-share | Single-call orchestrator: auto-submit care-context link (if token available) and share when linked | Bearer |
| GET | /api/v3/records/{id}/workflow-status | Poll record workflow status (record + care-context link state + next action for HMS) | Bearer |
| HIP-INITIATED LINKING (HMS → Bridge → ABDM) | |||
| POST | /api/v3/hfr/hrp/link | Optional prereq — register/update facility service link before HIP linking | Bearer |
| POST | /api/v3/hip/link-token | Step 1 — Request a one-time JWT link token for a patient from ABDM (async; token arrives via callback) | Bearer |
| POST | /api/v3/hip/link/carecontext | Step 2 — Link care contexts to patient's ABHA using the link token | Bearer |
| GET | /api/v3/hip/link/patient/links | Fetch all care contexts linked for a patient (?abha_address=xxx) | Bearer |
| POST | /api/v3/hip/link/notify | Notify ABDM of a care-context update for a patient | Bearer |
| POST | /api/v3/hip/link/sms-notify | Send ABDM deep-link SMS to patient's mobile | Bearer |
| ABHA MANAGEMENT | |||
| POST | /api/v3/abha/validate | Validate ABHA ID or ABHA Address | Bearer |
| POST | /api/v3/abha/aadhaar/generate-otp | Create ABHA — Step 1: Send OTP to Aadhaar-linked mobile | Bearer |
| POST | /api/v3/abha/aadhaar/verify-otp | Create ABHA — Step 2: Verify OTP, create/retrieve ABHA. Response includes patient_id + gateway_patient (full saved profile from gateway DB). | Bearer |
| POST | /api/v3/abha/enrol/mobile/request-otp | Create ABHA (Child/Alternate No) — Step 2a: Send OTP to parent's alternate mobile (bound to Aadhaar txnId) | Bearer |
| POST | /api/v3/abha/enrol/mobile/verify-otp | Create ABHA (Child/Alternate No) — Step 2b: Verify alternate mobile OTP & finish child's ABHA enrolment | Bearer |
| POST | /api/v3/abha/mobile/generate-otp | Link ABHA — Step 1: Send OTP to registered mobile | Bearer |
| POST | /api/v3/abha/mobile/verify-otp | Link ABHA — Step 2: Verify Mobile OTP. Bridge automatically completes ABDM account selection internally, converts the 300s token into the 1800s Profile X-Token, and delivers official_card & gateway_patient directly inline. | Bearer |
| POST | /api/v3/abha/login/select-account | Select Account (Mobile Login) — Exchange 300s Mobile OTP token + selected abha_number / abha_address for 1800s Profile X-Token & official card. | Bearer |
| GET | /api/v3/abha/card | Download Official ABHA Card — Fetches genuine ABDM-issued ABHA Card. Pass patient token or X-Token. Returns card_source: "abdm" when ABDM issues the card, or card_source: "none" (with official_card: null) if ABDM does not issue a card for the session. Zero locally generated cards. | Bearer |
| OPD QUEUE & FACILITY | |||
| GET | /api/v3/facility/qr-code | Fetch facility details and Base64 QR code image | Bearer |
| GET | /api/v3/opd/queue | List OPD tokens for this hospital (date-filtered) | Bearer |
| POST | /api/v3/opd/token | Create a new OPD token (patient check-in) | Bearer |
| PATCH | /api/v3/opd/token/{id} | Update token status (PENDING / CALLED / COMPLETED / CANCELLED) | Bearer |
| GET | /api/v3/opd/running-token-status | Get current token being served at this HIP | Bearer |
| DRUG TERMINOLOGY (CDCI) — HMS SEARCH / AUTOCOMPLETE | |||
| GET | /api/v3/drugs/autocomplete?q=par&type=generic&limit=10 | Fast type-ahead list for drug name inputs. Use from HMS prescription/dispense UI as user types. | Bearer |
| GET | /api/v3/drugs/search?q=paracetamol&type=generic&limit=20&offset=0 | Paginated full search in CDCI index. Returns matching entries with type + identifier + metadata. | Bearer |
| GET | /api/v3/drugs/detail?type=generic&identifier=419367007&view=hms_fill | Fetch canonical record, or HMS-friendly projection with view=hms_fill. | Bearer |
| POST | /api/v3/drugs/detail/bulk | Batch detail lookup by identifiers (up to 200 per call) with optional view=hms_fill. | Bearer |
| GET | /api/v3/drugs/by-barcode?barcode=8901234567890 | Barcode helper route (currently returns DATASET_UNAVAILABLE until barcode mapping is integrated). | Bearer |
| GET | /api/v3/drugs/version | Returns latest import run info and table counts. Use in HMS diagnostics/health dashboard. | Bearer |
| GET | /api/v3/drugs/masters?master=company&limit=100 | Fetch CDCI-backed HMS master lists (company, formulation, short_formulation, generic) for local HMS master sync. Data is served from the gateway CDCI database (not a live ABDM M3 drug-masters proxy). Use master=company for Drug Company dropdown. | Bearer |
| GET | /api/v3/drugs/formulation-mappings?limit=100 | Fetch effective long-formulation to short-formulation mappings including manual overrides configured in Admin. | Bearer |
| GET | /api/v3/pathology/masters?sub_category=PATHOLOGY&limit=200 | Fetch pathology tests from Clinical Test Master for HMS catalog sync (supports search + incremental sync with updated_since). | Bearer |
| GET | /api/v3/pathology/components?parent_test=Complete Blood Count Panel&limit=200 | Fetch panel-to-component mappings (CBC/LFT/etc.) including LOINC code metadata and sort order. | Bearer |
| GET | /api/v3/pathology/panels?panel_type=PANEL&limit=200 | Dedicated pathology panel master endpoint for HMS panel catalog sync (PANEL/META_PANEL). | Bearer |
| GET | /api/v3/pathology/component-masters?sub_category=Hematology&limit=200 | Dedicated pathology component master endpoint for HMS component catalog sync from abdm_lab_test_master. | Bearer |
| GET | /api/v3/pathology/expand?entity_type=panel&id=1 | Expand panel/meta-panel into atomic tests and return printable template payload (print_template) with component tokens. | Bearer |
| GET | /api/v3/surgeries/masters?procedure_type=SURGICAL&limit=200 | Fetch procedure master with procedure_type (SURGICAL/NON_SURGICAL), SNOMED CT code, body site and notes for OT/IPD/therapy catalog sync. | Bearer |
| GET | /api/v3/radiology/masters?limit=200 | Fetch radiology/imaging master with SNOMED CT code, modality, body site, and ImagingStudy-oriented metadata. | Bearer |
| GET | /api/v3/radiology/xray?limit=200 | Dedicated radiology X-Ray endpoint for HMS imaging catalog sync. | Bearer |
| GET | /api/v3/radiology/ctscan?limit=200 | Dedicated radiology CT Scan endpoint for HMS imaging catalog sync. | Bearer |
| GET | /api/v3/radiology/mri?limit=200 | Dedicated radiology MRI endpoint for HMS imaging catalog sync. | Bearer |
| GET | /api/v3/radiology/ultrasound?limit=200 | Dedicated radiology Ultra Sound endpoint for HMS imaging catalog sync. | Bearer |
| GET | /api/v3/surgeries/icd10pcs?limit=200 | Fetch surgery-to-ICD-10-PCS crosswalk for billing/package engines mapped with SNOMED CT procedures. | Bearer |
| GET | /api/v3/master-data/immunization/uip/version | Fetch latest active immunization schedule version code, effective date, and payload checksum. | Bearer |
| GET | /api/v3/master-data/immunization/uip | Fetch full baseline national UIP vaccination schedule catalog for HMS sync. | Bearer |
| GET | /api/v3/master-data/immunization/uip/changes | Fetch incremental delta updates since the HMS's current schedule version. | Bearer |
| SNOMED CT TERMINOLOGY API — HIGH PERFORMANCE SEARCH & LOOKUP | |||
| GET | /api/search/suggest?term=fever&returnlimit=10 | Fast term auto-suggest for HMS clinical UI inputs (returns JSON array of term strings). | Public / Bearer |
| GET | /api/search/search?term=fever&returnlimit=10 | Detailed concept search with FSN, concept status, and terminology metadata output. | Public / Bearer |
| GET | /api/lookup/concept?id=386661006 | Full concept detail lookup with synonyms, FSN, module ID, and definition status. | Public / Bearer |
| GET | /api/explore/parents?id=386661006 | Explore parent concepts in IS-A taxonomy hierarchy. | Public / Bearer |
| GET | /api/explore/children?id=386661006 | Explore child concepts in IS-A taxonomy hierarchy. | Public / Bearer |
| GET | /api/validate/id?id=386661006 | Validate if SCTID concept ID or description ID exists and is active. | Public / Bearer |
| GET | /api/map/icdmap?id=386661006 | Fetch SNOMED CT to ICD-10 crosswalk extended map. | Public / Bearer |
| M3 HIU OPERATIONS | |||
| POST | /api/v3/hiu/consent/request | Create ABDM consent request for patient records | Bearer |
| POST | /api/v3/hiu/consent/request/status | Request status update for consent request from ABDM | Bearer |
| POST | /api/v3/hiu/consent/request/fetch | Initiate fetching details of granted consent artifact from ABDM | Bearer |
| POST | /api/v1/hiu/data/request | Initiate clinical data request flow from HIP to Gateway (Recommended) | Bearer |
| GET | /api/v1/hiu/consent/status | Poll/get local consent status & artifact info (for NAT backend) | Bearer |
| GET | /api/v1/hiu/data/fetch | Poll/get decrypted clinical records for a session (for NAT backend) | Bearer |
| M2 HIP OPERATIONS & FHIR BUNDLE | |||
| POST | /api/v3/bundle/push | Push FHIR R4 health document bundle to Gateway datastore | Bearer |
| UNIFIED BRIDGE (event dispatcher) | |||
| POST | /api/v1/bridge | Recommended for HMS — single event-based endpoint, routes to correct ABDM service automatically | Bearer |
| M2 USER-INITIATED LINKING (BRIDGE → HMS WEBHOOKS OVER VPN) | |||
| POST | /records/discover (or /v3/hip/patient/care-context/discover) | Bridge → HMS: Discover walk-in patient by verified mobile, gender, YOB, name; return care contexts | Bearer / HMAC |
| POST | /records/link/init (or /v3/hip/link/patient/care-context/init) | Bridge → HMS: Generate OTP & create link transaction for patient's care contexts | Bearer / HMAC |
| POST | /records/link/confirm (or /v3/hip/link/patient/care-context/confirm) | Bridge → HMS: Verify OTP, link ABHA address to patient, mark health records as linked | Bearer / HMAC |
| ABDM → BRIDGE CALLBACKS (Gateway calls Bridge; Bridge forwards to HMS) | |||
| POST | /v3/hip/patient/care-context/discover | ABDM calls bridge → Bridge forwards to HMS /records/discover → responds via /on-discover | ABDM |
| POST | /v3/hip/link/patient/care-context/init | ABDM calls bridge → Bridge forwards to HMS /records/link/init → responds via /on-init | ABDM |
| POST | /v3/hip/link/patient/care-context/confirm | ABDM calls bridge → Bridge forwards to HMS /records/link/confirm → responds via /on-confirm | ABDM |
| POST | /v3/hip/patient/status/notify | ABDM notifies patient link status change | ABDM |
| POST | /api/hiecm/hip/v3/link/context/notify | ABDM notifies HIP-initiated link completion | ABDM |
| POST | /api/hiecm/data-flow/v3/health-information/hip/request | ABDM requests health data — bridge pushes FHIR bundle to patient via dataPushUrl | ABDM |
| POST | /api/hiecm/consent/v3/hip/notify | ABDM notifies consent grant / revocation — bridge fires HMS webhook | ABDM |
| POST | /api/v3/hip/token/on-generate-token | ABDM delivers the generated JWT link token to bridge (HIP-initiated linking step 1 callback) | ABDM |
| POST | /api/v3/link/on_carecontext | ABDM confirms care-context linking result (HIP-initiated linking step 2 callback) | ABDM |
/api/v3/drugs/autocomplete during typing, then call /api/v3/drugs/detail after user selection to store canonical identifiers in your HMS record. For Drug Company master sync, call /api/v3/drugs/masters?master=company. All endpoints use hospital Bearer token auth.
/api/v3/drugs/autocomplete, /api/v3/drugs/detail, /api/v3/drugs/masters) are served from the imported local CDCI dataset in gateway DB. ABDM upstream proxying applies to ABHA/HIECM flows, not to runtime drug master fetch in this integration.
No company records found. Use Sync From API to seed company masters from drug payloads., run sync from /api/v3/drugs/masters?master=company and map items[].name as company name and items[].identifier as company code.
score, matched_on, and exact_match. Detail supports view=canonical (default) and view=hms_fill, including short_formulation for HMS UI fill. Standard errors use { ok, error_code, message, details, request_id }.
Use for search box suggestions (minimum 2 chars, limit defaults to 10).
| Query Param | Required | Description |
|---|---|---|
q | required | Typed search text, e.g. par |
type | optional | generic, brand, product, substance |
limit | optional | Max suggestions (1 to 50) |
Use for full results screen with pagination.
Use after item selection to fetch structured details and save identifier in HMS. Add view=hms_fill to get HMS-oriented fields directly.
Resolve multiple identifiers in one call. Supports view=canonical or view=hms_fill.
Barcode helper endpoint. Current CDCI import does not include barcode mapping, so this endpoint returns DATASET_UNAVAILABLE until enrichment is added.
Use in admin/HMS diagnostics to verify CDCI data freshness and import counts.
Use this to sync normalized master data in HMS dropdowns and validation tables. Supports company, formulation, short_formulation, and generic. Source is local CDCI tables inside gateway DB.
| Query Param | Required | Description |
|---|---|---|
master | required | company | formulation | short_formulation | generic |
q | optional | Search filter (contains match) |
limit | optional | Page size (default 100, max 500) |
offset | optional | Pagination offset (default 0) |
Use this to map long CDCI formulation labels to HMS short labels. Returned effective_short_formulation already applies manual admin override when available.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in long/suggested/effective short labels |
overrides_only | optional | 1/true to fetch only manual overrides |
limit | optional | Page size (default 100, max 500) |
offset | optional | Pagination offset (default 0) |
/api/v3/pathology/panels for panel catalog, sync /api/v3/pathology/component-masters for atomic pathology components, then use /api/v3/pathology/components for panel-to-component mapping. Use updated_since for incremental sync after initial bootstrap.
abdm_clinical_test_master and abdm_pathology_panel_components) curated from LOINC-oriented datasets and admin mappings. These are not live pull-through endpoints to ABDM.
Use this for pathology test catalog sync in HMS. Returns test-level records from Clinical Test Master where category is Pathology.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in test_name, display_name, code, subcategory |
sub_category | optional | Exact filter (e.g. PATHOLOGY, Microbiology) |
updated_since | optional | Incremental sync filter on updated_at (YYYY-MM-DD HH:MM:SS) |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Use this for panel to component sync. Each row represents one component test mapped to a parent panel.
| Query Param | Required | Description |
|---|---|---|
parent_test | optional | Exact parent panel name (recommended for on-demand component load) |
q | optional | Search in parent/component/code fields |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Dedicated panel catalog endpoint for HMS. Use this for panel and meta-panel masters.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in panel name, description, sub category, code |
panel_type | optional | PANEL or META_PANEL |
sub_category | optional | Exact panel sub category filter |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Dedicated pathology component master endpoint (atomic tests) for HMS local component catalog sync.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in component name, short name, and code |
sub_category | optional | Exact pathology sub category filter |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Expands a panel/meta-panel to atomic tests for order/result engines and now also returns a ready print-template structure.
| Query Param | Required | Description |
|---|---|---|
entity_type | required | panel, meta_panel, or test |
id | optional | Entity ID selector (recommended) |
name | optional | Entity name selector (if id not supplied) |
code | optional | Entity code selector (if id/name not supplied) |
include_inactive | optional | 1/true to include inactive rows |
max_depth | optional | Max recursion depth for nested meta-panels (default 8) |
The expand API now returns an edit_component_rule array inside print_template, matching the admin Edit Component Rule modal fields.
Sync strategy: run full sync once (page through by limit/offset), then run incremental sync every few minutes using updated_since=last_success_sync_time.
SNOMED CT as clinical procedure coding baseline. If your billing engine requires additional code sets (for example ICD-10-PCS), keep them in a local mapping table keyed by SNOMED CT.
Procedure resource, imaging to DiagnosticReport (often with ImagingStudy), and lab values to Observation.
Sync starter/common surgeries and procedures into HMS OT master, package master, and billing mapping tables.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in procedure name, SNOMED code, body site, notes |
body_site | optional | Filter by body site text (for example Heart, Uterus) |
snomed_code | optional | Exact SNOMED CT code match |
procedure_type | optional | Filter by SURGICAL or NON_SURGICAL |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Related sub-table API for billing crosswalk. Keep SNOMED CT as clinical source and ICD-10-PCS as billing mapping.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in procedure name, SNOMED code, ICD-10-PCS code/title |
snomed_code | optional | Exact SNOMED CT code filter |
icd10pcs_code | optional | Exact ICD-10-PCS code filter |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
XR, CT, MR, US, MG) as first-class fields in HMS and map clinical meaning with SNOMED CT.
ImagingStudy for acquisition metadata and a DiagnosticReport referencing that ImagingStudy for narrative findings and impression.
Sync radiology service master for RIS/PACS orderables, report templates, and billing mappings.
| Query Param | Required | Description |
|---|---|---|
q | optional | Search in imaging name, SNOMED code, modality, body site, notes |
modality | optional | Exact modality code (for example XR, CT, MR, US, MG) |
body_site | optional | Filter by body site text |
snomed_code | optional | Exact SNOMED CT code match |
updated_since | optional | Incremental sync filter on updated_at |
include_inactive | optional | 1/true to include inactive rows |
limit | optional | Page size (default 200, max 1000) |
offset | optional | Pagination offset (default 0) |
Use these dedicated endpoints when HMS wants separate modality-wise sync APIs without passing modality as a query parameter.
| Endpoint | Description |
|---|---|
/api/v3/radiology/xray | X-Ray modality focused catalog endpoint. |
/api/v3/radiology/ctscan | CT Scan modality focused catalog endpoint. |
/api/v3/radiology/mri | MRI modality focused catalog endpoint. |
/api/v3/radiology/ultrasound | Ultra Sound modality focused catalog endpoint. |
Fast type-ahead search endpoint for HMS clinical text inputs (e.g., OPD diagnosis, Chief Complaints, Procedures). Returns a JSON array of matching terms.
| Parameter | Type | Description |
|---|---|---|
term | required | Search prefix or phrase (e.g. fever, diabetes, appendectomy). |
returnlimit | optional | Maximum results to return (default: 10, max: 500). |
semantictag | optional | Filter by SNOMED semantic tag (e.g., finding, disorder, procedure). |
Detailed concept search endpoint returning full concept metadata (concept ID, term, FSN, definition status, effective time).
Retrieve complete concept details, including FSN, active status, module ID, definition status, and list of all synonym descriptions.
Explore SNOMED CT taxonomy hierarchy up (parents) or down (children) for IS-A relationships.
Validate SCTID concept/description status, or fetch SNOMED CT to ICD-10 crosswalk mapping for billing engines.
Use this endpoint to retrieve insurance benefit eligibility/mapping data for patient-side workflows and claims pre-check flows in HMS.
/api/v3/master-data/immunization/uip/version. If the checksum or version code differs from your local database, sync the full schedule using /api/v3/master-data/immunization/uip or fetch delta changes with /api/v3/master-data/immunization/uip/changes?since_version={local-version}.
Retrieve version details, effective date, and SHA-256 data checksum of the active UIP schedule.
Fetch the entire baseline national UIP vaccination schedule catalog (all 26 seeded vaccine doses, offset days, route, site, and disease mappings).
Fetch incremental audit log changes since a specific schedule version.
📋 The Core Compliance Requirement Flagged by ABDM
The Problem: Previously, hospital software assumed that patients visiting the clinic already had an ABHA address linked in the HMS database before discovery (e.g. searching records with WHERE abha_id = 'user@sbx'). Because walk-in patients have no ABHA ID when registered at the hospital reception, this search always returned 0 records found in the PHR app.
The Compliant Flow: 1. Walk-in Registration (No ABHA) → 2. Visit / Prescription Created in HMS → 3. Patient opens PHR App at Home → 4. Demographic Discovery (Mobile + Gender + YOB + Name) → 5. OTP Link Verification → 6. Permanent ABHA Linked
POST /records/discoverAliases:
/v3/hip/patient/care-context/discover, /api/v1/abdm/gateway/discovery/care-contexts
Extracts verified mobile from patient.verifiedIdentifiers, gender, year-of-birth, and name. Queries patient_master and returns all visit care contexts.
POST /records/link/initAliases:
/v3/hip/link/patient/care-context/init, /api/v1/abdm/gateway/link/init
Receives selected care contexts, generates a 6-digit SMS OTP, creates a pending session in abdm_link_transactions, and returns masked mobile hint (e.g. 92******58).
POST /records/link/confirmAliases:
/v3/hip/link/patient/care-context/confirm, /api/v1/abdm/gateway/link/confirm
Verifies OTP (test bypass 123456 in sandbox), updates patient_master.abha_address, sets health_records.push_status = 'linked', and completes link.
The Bridge sends the patient's verified demographic identifiers received from the PHR app. Your HMS must match candidates in patient_master and return their care contexts.
- Mobile Matching: Extract 10 digits from verified mobile (e.g.
9212609558). Filter candidate patients inpatient_master WHERE mphone1 = '9212609558'. - Gender Matching: Verify candidate gender matches (e.g.
Mmatches1orMALE). - Year of Birth (±2 years tolerance): ABDM permits a 2-year tolerance window. If
patient.yearOfBirth = 1999, match againstYEAR(dob) BETWEEN 1997 AND 2001. - Name Verification: Ensure first name / last name matches with string similarity or substring match.
- Care Contexts: Retrieve all clinical episodes (OPD prescriptions, lab tests, discharge summaries) for the matched
patient_id.
The PHR user has selected which care contexts to link. The Bridge requests the HMS to generate an OTP session for this patient.
patient.referenceNumber.2. Generate a secure 6-digit OTP (e.g.
123456 in sandbox / random OTP in production) and a unique link reference (e.g. LNK-HEX).3. Store the OTP session in
abdm_link_transactions with status = 'PENDING' and 10-minute expiry.4. Dispatch SMS with OTP to the patient's phone and return the masked mobile hint (e.g.
92******58).
The patient entered the OTP in the PHR app. ABDM passes the OTP token to the Bridge, which forwards it to the HMS to verify and finalize the linking.
UPDATE patient_master SET abha_address = 'rahulsingh@sbx', abha_verified_status = 'LINKED', abdm_linked_at = NOW() WHERE id = {patient_id};UPDATE health_records SET abha_id = 'rahulsingh@sbx', push_status = 'linked', linked_at = NOW() WHERE patient_id = {patient_id};UPDATE abdm_link_transactions SET status = 'COMPLETED', updated_at = NOW() WHERE txn_id = 'LNK-C86A70457F2E7EB4';
Run this SQL on your HMS database to store pending OTP sessions:
Run these cURL commands directly against your HMS server to verify:
Domain Name in HMS credential settings).
Gateway-local tables are for audit/orchestration metadata, not primary M2 clinical source.
Gateway calls these HMS APIs using https://{hms_domain} for each hospital:
GET /api/v1/abdm/gateway/healthPOST /api/v1/abdm/gateway/discovery/care-contextsPOST /api/v1/abdm/gateway/health-information/fetchPOST /api/v1/abdm/gateway/consent/upsertPOST /api/v1/abdm/gateway/link/status
Security headers required on Gateway → HMS calls: Authorization: Bearer ..., X-Eka-Signature, X-Request-Id, X-Timestamp.
| # | What HMS must do | Detail |
|---|---|---|
| ★ | Get a hospital-specific API token RECOMMENDED | Ask your gateway admin to create a Hospital User for your hospital (Admin → Hospital Users → Create User). Use the issued token as Authorization: Bearer {token}. Your hospital is auto-identified — no hfr_id field needed. Tokens can be regenerated or revoked per hospital without affecting others. |
| 1 | Generate a unique care_context_reference per visit | Use a pattern like OPD-{YYYYMMDD}-{patientId} or IPD-{admissionId}. Never reuse the same reference — a second push with the same value returns 409 DUPLICATE_RECORD with the existing record info. |
| 2 | Build a valid FHIR R4 document bundle | Must be resourceType:"Bundle", type:"document". First entry = Composition. Must include Patient + at least one clinical resource per HI type. See FHIR Bundle Guide for copy-paste examples. |
| 3 | Send correct hi_type | Must be one of the 8 ABDM values: OPConsultRecord, PrescriptionRecord, DiagnosticReportRecord, DischargeSummaryRecord, ImmunizationRecord, WellnessRecord, HealthDocumentRecord, InvoiceRecord |
| 4 | Store both record_id and queue_id from the 201 response | record_id — used to fetch/share the record later via GET /records/{id} or POST /records/{id}/share.queue_id — used to match the record_linked_callback webhook payload back to the HMS visit record. |
| 5 | Handle 409 DUPLICATE_RECORD | Do not treat this as an error. The response contains existing_record_id and first_pushed_at. Use existing_record_id for linking — no need to push again. |
| 6 | Handle 422 FHIR_VALIDATION_FAILED | Log the errors[] array from the response. Each entry has code, field, message. Fix your bundle builder and retry. The warnings[] array is non-blocking — ABDM will still accept the record. |
| 7 | Implement record_linked_callback webhook endpoint | The gateway fires a signed POST to {HMS_BASE_URL}/AbdmGateway/record_linked_callback when a patient links the record. Match on queue_id. Verify X-Eka-Signature. Return HTTP 200. See Webhooks section. |
| Field | Type | Required | Description |
|---|---|---|---|
hi_type | string | required | ABDM HI type: OPConsultRecord | PrescriptionRecord | DiagnosticReportRecord | DischargeSummaryRecord | ImmunizationRecord | WellnessRecord | HealthDocumentRecord | InvoiceRecord |
fhir_bundle | object | required | Valid FHIR R4 Bundle (resourceType:"Bundle", type:"document"). See FHIR Bundle Guide. |
care_context_reference | string | required | Unique visit/episode ID per hospital, e.g. OPD-2026-05-22-001. Gateway rejects duplicates (409). |
abha_id | string | one of* | 14-digit ABHA number e.g. 91-5101-6530-5101 |
abha_address | string | one of* | ABHA address e.g. patient@abdm |
patient_mobile | string | one of* | 10-digit mobile number e.g. 9720958717 (alias: mobile) — required for non-ABHA patients |
care_context_display | string | optional | Human label shown in PHR app. Auto-generated if omitted: OPConsultRecord — 2026-05-22 — Dr. Sharma |
patient_name | string | optional | Patient full name (stored in shared patient registry) |
local_patient_id | string | optional | HMS internal patient MRN — stored in hospital sub-table for reference |
visit_date | date | optional | Date of visit YYYY-MM-DD |
doctor_name | string | optional | Treating doctor name |
department | string | optional | Department / speciality |
gender | string | optional | M | F | O |
year_of_birth | number | optional | 4-digit birth year e.g. 1979 (alias: date_of_birth) |
hfr_id | string | required | Your hospital’s ABDM Facility Registry ID (e.g. IN0510000828). Required for all token types. With a hospital-specific API key the value is validated against the HFR ID registered to that key — a mismatch returns 403 HFR_ID_MISMATCH. With the gateway master token a missing value returns 400 HFR_ID_REQUIRED and an unregistered value returns 403 HFR_ID_NOT_REGISTERED. |
abha_id, abha_address, or patient_mobile (or mobile) is required. For non-ABHA patients, push with patient_mobile and patient_name — ABDM Discovery will automatically match by Mobile Number when the patient uses the ABHA app later.List records for this hospital. record_data and fhir_validation_log are omitted for performance — use GET /records/{id} for the full bundle.
GET returns full record including decoded fhir_bundle. POST /link-and-share is the recommended single HMS action: it submits link if needed and completes share once linked. GET /workflow-status provides pollable progress and next step.
resourceType:"Bundle", type:"document".
The first entry must always be a Composition resource with a subject (Patient reference).
A Patient resource must also appear in the bundle entries.
The gateway validates all of this and returns a detailed errors[] array if anything is wrong.
Use this when you want gateway patient registry to be ready before first clinical record. ABHA fields are optional.
Use this when HMS has a single fhir_resource object (Encounter, DiagnosticReport, etc.). Gateway wraps it into a document bundle and pushes through the standard records pipeline.
| ABDM hi_type | Your HMS Record | Required FHIR Resources | Optional / Recommended |
|---|---|---|---|
OPConsultRecord | OPD Consultation | Composition + Patient + one of: Condition, MedicationRequest, Observation | Practitioner, Organization, AllergyIntolerance, ServiceRequest, Appointment |
PrescriptionRecord | OPD Prescription | Composition + Patient + MedicationRequest | Practitioner, Organization |
DiagnosticReportRecord | Lab Report / Radiology | Composition + Patient + DiagnosticReport | Observation (test results), ImagingStudy (radiology), DocumentReference (PDF attachment) |
DischargeSummaryRecord | IPD Discharge | Composition + Patient + Encounter + (Condition or Procedure) | Practitioner, Organization, MedicationRequest, CarePlan |
ImmunizationRecord | Vaccination record | Composition + Patient + Immunization | ImmunizationRecommendation |
WellnessRecord | Vitals / wellness | Composition + Patient + Observation | Multiple Observation entries (BP, SpO2, weight, glucose, etc.) |
HealthDocumentRecord | Scanned / uploaded doc | Composition + Patient + DocumentReference | Binary attachment embedded in DocumentReference.content.attachment |
InvoiceRecord | Billing / pharmacy invoice | Composition + Patient + Invoice | Organization (pharmacy/hospital) |
- Bundle.resourceType must be
Bundle - Bundle.type must be
document - First entry must be
Composition - Bundle must include a
Patiententry - For
OPConsultRecord, include at least one clinical resource:ConditionorMedicationRequestorObservation
- Use SNOMED coding for diagnosis (
Condition.code.coding) - Use coded medicine concept where possible (
MedicationRequest.medicationCodeableConcept.coding) - Include
PractitionerandOrganizationresources - Keep all date-time values in ISO 8601 with timezone
POST /api/v3/records/{id}/link-and-share and poll GET /api/v3/records/{id}/workflow-status. Use /share as manual fallback.
| Concept | SNOMED Code | Display | Use in |
|---|---|---|---|
| Hypertension | 38341003 | Hypertensive disorder | Condition |
| Diabetes mellitus | 73211009 | Diabetes mellitus | Condition |
| Fever | 386661006 | Fever | Condition / Observation |
| Cough | 49727002 | Cough | Condition |
| Asthma | 195967001 | Asthma | Condition |
| Paracetamol / Acetaminophen | 387517004 | Paracetamol | MedicationRequest |
| Amoxicillin | 372687004 | Amoxicillin | MedicationRequest |
| Amlodipine | 372656004 | Amlodipine | MedicationRequest |
| Metformin | 372567009 | Metformin | MedicationRequest |
| Blood glucose (fasting) | LOINC 1558-6 | Fasting blood glucose | Observation |
| Systolic BP | LOINC 8480-6 | Systolic blood pressure | Observation |
| Diastolic BP | LOINC 8462-4 | Diastolic blood pressure | Observation |
| SpO2 | LOINC 59408-5 | Oxygen saturation | Observation |
| Body weight | LOINC 29463-7 | Body weight | Observation |
| HTTP | error code | message example | Fix |
|---|---|---|---|
400 | INVALID_HI_TYPE | hi_type must be one of the 8 ABDM HI types | Use exact name: OPConsultRecord, PrescriptionRecord, etc. (case-sensitive) |
400 | MISSING_FIELD | fhir_bundle is required | Send fhir_bundle as a nested JSON object, not a string |
422 | FHIR_VALIDATION_FAILED | resourceType must be "Bundle" | Wrap your entire FHIR document in a Bundle object at the top level |
422 | FHIR_VALIDATION_FAILED | Bundle type must be "document" | Set "type": "document" on the Bundle (not transaction or collection) |
422 | FHIR_VALIDATION_FAILED | First entry must be Composition | Move the Composition resource to entry[0] |
422 | FHIR_VALIDATION_FAILED | Composition missing subject | Add "subject": { "reference": "Patient/pat-1" } to Composition |
422 | FHIR_VALIDATION_FAILED | No Patient resource found | Add a Patient resource entry to the bundle with "id": "pat-1" |
422 | FHIR_VALIDATION_FAILED | OPConsultRecord requires Condition or MedicationRequest | Add at least one clinical resource to the bundle |
409 | DUPLICATE_RECORD | care_context_reference already pushed | Check existing_record_id in response — use that instead of pushing again |
POST /api/v3/hfr/hrp/link (optional setup) →
POST /api/v3/hip/link-token →
POST /api/v3/hip/link/carecontext →
GET /api/v3/hip/link/patient/links →
POST /api/v3/hip/link/notify (when metadata changes) →
POST /api/v3/hip/link/sms-notify.
ABDM app discovery/link (callback mode): ABDM calls
/api/hiecm/user-initiated-linking/v3/patient/care-context/discover,
/api/hiecm/user-initiated-linking/v3/link/care-context/init, and
/api/hiecm/user-initiated-linking/v3/link/care-context/confirm. HMS should keep ABHA and care-context references accurate in pushed records.
/api/v3/hip/link-token → async callback /api/v3/hip/token/on-generate-token/api/hiecm/v3/token/generate-token and returns a request_id immediately.
ABDM delivers the JWT link_token asynchronously via the bridge callback (stored in abdm_link_tokens table). Decode the returned link_token_id to use in step 2./api/v3/hip/link/carecontext → async callback /api/v3/link/on_carecontextlink_token_id from step 1. Bridge calls ABDM /api/hiecm/hip/v3/link/carecontext with the JWT as X-LINK-TOKEN header.
ABDM confirms linking via callback — bridge marks records as linked and fires record_linked_callback webhook to HMS.Fetch all care contexts currently linked in ABDM for a patient. Pass ?abha_address= or ?limit=.
notify — Push a care-context update notification to ABDM.
sms-notify — Trigger ABDM to send deep-link SMS to patient's registered mobile.
On every successful
aadhaar/verify-otp or mobile/verify-otp, the gateway automatically saves the Aadhaar-verified patient data into its internal Patient Master (abdm_patients table). The response includes two extra fields so HMS can store and use them:
| Response Field | Type | Description & HMS Usage |
|---|---|---|
patient_id | integer | Gateway's internal patient ID. Store as abdm_gateway_patient_id in HMS patient record. Required when pushing health records. |
gateway_patient.abha_id | string | 14-digit ABHA number (no dashes) — store as abha_number in HMS |
gateway_patient.abha_address | string | ABHA address e.g. 91510165305101@abdm — required for Push ABDM |
gateway_patient.full_name | string | Aadhaar-verified full name — auto-fill HMS patient name |
gateway_patient.gender | M / F / O | Gender — auto-fill HMS gender |
gateway_patient.date_of_birth | YYYY-MM-DD | Date of birth — auto-fill HMS DOB |
gateway_patient.mobile | string | Registered mobile number |
gateway_patient.email | string | Email address (if available from ABDM) |
gateway_patient.address_line | string | Address from Aadhaar |
gateway_patient.district | string | District name |
gateway_patient.state_name | string | State name |
gateway_patient.pincode | string | PIN code |
Response includes
patient_id + gateway_patient with all Aadhaar-verified demographics.Response includes
patient_id + gateway_patient with verified profile for HMS auto-fill.patient_id in your HMS patient record as abdm_gateway_patient_id. Use gateway_patient fields to auto-fill Name, DOB, Gender, Mobile, Address. On repeat OTP flows for the same patient, only non-blank fields update — existing verified data is preserved.
Do NOT call
POST /api/v3/abha/mobile/generate-otp without txnId for alternate mobile verification. Doing so triggers a Profile Login for the parent's mobile number, returning the parent's existing ABHA card instead of creating the child's ABHA card.
patient_id in HMS as abdm_gateway_patient_id. Auto-fill patient demographics from gateway_patient. Also includes token in data for ABHA card download via GET /api/v3/abha/card?token=....
| Endpoint | Description | Key Fields |
|---|---|---|
GET /api/v3/facility/qr-code | Get facility details and official QR code Base64 string | Returns hospital_id, hospital_name, hfr_id, qr_data |
POST /api/v3/opd/token | Create manual token for walk-in patient | patient_name, phone, abha_number, gender, department, department_code, date |
GET /api/v3/opd/queue | List queue with pagination — optional ?date=YYYY-MM-DD&status=PENDING | Returns summary, pagination, and tokens[] with token_number, status, abha_number, source |
PATCH /api/v3/opd/token/{id} | Update token status | status: PENDING | CALLED | COMPLETED | CANCELLED |
GET /api/v3/opd/running-token-status | Get current token being served (for display boards) | Returns token_number, department |
Send a single event_type with a payload. The bridge routes it to the correct ABDM service automatically.
| event_type | Description | Required payload fields |
|---|---|---|
abdm.abha.validate | Validate ABHA ID | abha_id or abha_address |
abdm.consent.requested | Request patient consent | abha_id, purpose_code, hi_types[] |
abdm.fhir.share.requested | Push any FHIR document | consent_handle, hi_type, bundle{} |
abdm.opd.prescription.share.requested | Share OPD prescription | consent_handle, bundle{} |
abdm.ipd.admission.share.requested | Share IPD admission summary | consent_handle, bundle{} |
abdm.ipd.discharge.share.requested | Share IPD discharge summary | consent_handle, bundle{} |
abdm.diagnosis.report.share.requested | Share diagnostic report | consent_handle, bundle{} |
abdm.scan_share.lookup | SNOMED CT term lookup | term, return_limit (optional) |
/records/discover, /records/link/init, /records/link/confirm), waits for your HMS JSON response, and dispatches the corresponding asynchronous on-discover, on-init, and on-confirm callbacks back to ABDM Gateway.
See the dedicated M2 User-Initiated Linking Guide above for implementation details.
/v3/hip/patient/care-context/discover → HMS /records/discoverPOST {HMS_VPN_DOMAIN}/records/discover with verified mobile, gender, YOB, and name. HMS returns matching care contexts, and Bridge responds to ABDM via /on-discover./v3/hip/link/patient/care-context/init → HMS /records/link/initPOST {HMS_VPN_DOMAIN}/records/link/init. HMS generates OTP & masked hint, Bridge creates a link session in abdm_link_sessions, and responds to ABDM via /on-init./v3/hip/link/patient/care-context/confirm → HMS /records/link/confirmPOST {HMS_VPN_DOMAIN}/records/link/confirm to verify OTP and link ABHA in HMS. Bridge marks local records as linked, calls ABDM /on-confirm, and completes the link transaction.ABDM notifies bridge when a HIP-initiated link (via /records/{id}/share) is confirmed. Bridge marks record as linked and fires record_linked_callback to HMS.
ABDM requests health data after consent is granted. Bridge acknowledges, fetches consent-scoped FHIR data from HMS API /api/v1/abdm/gateway/health-information/fetch, pushes to dataPushUrl, and notifies ABDM of completion.
ABDM notifies bridge when a patient grants or revokes consent for this HIP.
- Initiate consent by calling
POST /api/v3/hiu/consent/request. - Poll for status changes using
GET /api/v1/hiu/consent/status. - Once status is
GRANTED, fetch the consent artifact usingPOST /api/v3/hiu/consent/request/fetch. - Request data flow using
POST /api/v1/hiu/data/request.
Creates a consent request to ask the patient for permission to view their health records.
Requests the current status of a consent request from ABDM.
Initiates a request to fetch the granted consent artifact details from ABDM after status changes to GRANTED.
Reconcile or check status of a consent request. Supply either the original HMS request_id, the ABDM consent_request_id, or the granted consent_id (artifact ID).
| Param | Required | Description |
|---|---|---|
request_id | optional | Original HMS request_id (e.g. REQ-CONSENT-...) |
consent_request_id | optional | ABDM-generated consent request ID |
consent_id | optional | ABDM-granted consent artifact ID |
Poll for decrypted clinical FHIR records. You can supply a transaction_id, a consent_id (artifact ID), or the original consent_request_id in the consent_id parameter to retrieve all merged hospital records at once.
| Param | Required | Description |
|---|---|---|
transaction_id | optional | The transaction ID generated for the data flow request |
consent_id | optional | The granted consent artifact ID (UUID) OR the original consent_request_id |
Note: Under the NAT/VPN model, the gateway automatically handles fetching consent details and triggering the data requests once a consent is GRANTED. You do not need to call this endpoint manually unless you wish to explicitly re-trigger a request.
dateRange must fall strictly inside or equal to the granted consent date range. You MUST NOT strip or modify the millisecond/timezone format (e.g. preserve .379Z or +05:30 exactly as returned by the Consent Status endpoint). Stripping fractional seconds will lead to immediate ABDM-1063: Date Range given is invalid errors.
Domain Name in Admin → HMS Credential and set HMS_WEBHOOK_SECRET.
The bridge resolves https://{hms_domain} and POSTs signed JSON when ABDM events occur. Always verify X-Eka-Signature before processing.
Fired when a care context record is successfully linked to a patient's ABHA in ABDM (user-initiated or HIP-initiated).
Fired when a patient revokes consent. Bridge also marks all linked records for this ABHA as revoked automatically.
Fired when ABDM notifies the gateway about GRANTED, REVOKED, or EXPIRED consent status changes. Your HMS must capture the consent_id and store it to initiate data flows.
| HTTP | error code | Meaning | Recommended Action |
|---|---|---|---|
200 | ok: 1 | Success | Process data or dispatch object |
201 | ok: 1 | Resource created (health record push) | Store returned record_id + queue_id in HMS DB |
202 | status: accepted | Async accepted (ABDM callbacks, share triggers) | No further action; callback webhook fires on completion |
400 | MISSING_FIELD | Required field missing or empty (hi_type, fhir_bundle, care_context_reference, or ABHA identifier) | Check request body — add the missing field listed in message |
400 | INVALID_HI_TYPE | hi_type is not one of the 8 ABDM values | Response includes valid_types[] — use one of those exact strings |
401 / 403 | UNAUTHORIZED | Invalid or missing API key | Verify Authorization: Bearer <key> header is correct |
404 | NOT_FOUND | Record ID not found | Confirm the ID exists and belongs to your hospital |
409 | DUPLICATE_RECORD | Same care_context_reference already pushed for this hospital | Not a failure — response includes existing_record_id + first_pushed_at. Use the existing record for linking. |
422 | FHIR_VALIDATION_FAILED | FHIR bundle has structural errors (wrong bundle type, missing Composition, missing required clinical resource) | Read errors[] array — each entry has code, field, message. The warnings[] are non-blocking. Fix bundle and retry. |
500 | SERVER_ERROR | Gateway internal error | Log the request_id and retry once. If persists, contact admin. |