canonical: https://jentic.com/apis/ndhm.gov.in/ndhm-gateway

# Ndhm Gateway

Jentic publishes the only available OpenAPI specification for Gateway, keeping it validated and agent-ready. The NDHM Gateway is the central hub of India's National Digital Health Mission that routes interactions between Consent Managers (CMs), Health Information Providers (HIPs), and Health Information Users (HIUs). The 48-endpoint surface covers care-context discovery, account linking, consent flows, health-data flow, identification, and monitoring - split across CM-facing, HIP-facing, and HIU-facing roles. Authorisation uses signed JWTs distributed via the Gateway's openid-configuration and certs endpoints.

## For AI agents

Route consent requests, care-context discovery, and health-data flows between Indian Consent Managers, Health Information Providers, and Health Information Users on the NDHM network.

## Scope

Does not host patient records, issue ABHA Health IDs, or run the patient-facing consent UI - use for orchestration of discovery, consent, and data flows between HIPs, HIUs, and CMs only.

## Capabilities

- Discover patient care contexts across registered Health Information Providers
- Initiate consent requests on behalf of Health Information Users
- Notify HIPs and HIUs of consent grant, revocation, and expiry events
- Coordinate health-data transfer flows including encryption key exchange
- Resolve patient identifiers to ABHA Health IDs for cross-provider linkage
- Provide JWT verification certificates and OpenID configuration for relying parties

## Use cases

### Cross-Provider Health Record Discovery

An HIU (e.g., a teleconsultation app) queries the NDHM Gateway to discover which HIPs hold records for a patient identified by ABHA. POST /v0.5/care-contexts/discover broadcasts the request and HIPs respond asynchronously through /on-discover. This replaces ad-hoc point-to-point integrations between hospitals and apps.

Example prompt: Call POST /v0.5/care-contexts/discover with the patient's ABHA identifier and listen for the corresponding /on-discover callback

### Consent-Based Data Sharing Workflow

An HIU requests consent from a Consent Manager to access patient records for a specific HIP and date range. POST /v0.5/consent-requests/init starts the flow, the patient grants or denies via the CM app, and POST /v0.5/consents/hiu/notify delivers the consent artefact when granted. The Gateway orchestrates the full lifecycle including status checks via /consent-requests/status.

Example prompt: Call POST /v0.5/consent-requests/init with the HIU id, purpose, and time range; poll /v0.5/consent-requests/status until the artefact is available

### Health Information Transfer Coordination

Once consent is granted, the Gateway coordinates the encrypted health-information transfer between HIP and HIU including key exchange and delivery notifications. The data-flow endpoints publish lifecycle events that auditors and analytics pipelines subscribe to. Built around the NDHM data-flow protocol.

Example prompt: Listen for /v0.5/health-information/notify events with status DATA_DELIVERED and reconcile against the original consent artefact

### Agent-Driven NDHM Integration

Health-tech teams use AI agents through Jentic to bootstrap an integration with the NDHM Gateway. The agent searches for the right consent or discovery endpoint, loads its schema, and submits the request, while Jentic handles the JWT-based bearer authorisation. Useful for building proof-of-concept HIUs and HIPs.

Example prompt: Search Jentic for 'initiate NDHM consent request' and execute POST /v0.5/consent-requests/init with the required HIU and patient fields

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v0.5/care-contexts/discover | Discover patient accounts across HIPs |
| POST | /v0.5/consent-requests/init | Create a consent request |
| POST | /v0.5/consents/fetch | Fetch a consent artefact |
| POST | /v0.5/consents/hiu/notify | Notify HIU of consent decision |
| GET | /v0.5/.well-known/openid-configuration | Get OpenID configuration |
| GET | /v0.5/certs | Get JWT verification certificates |

## Key resources

- **Discovery** — Care-context discovery across HIPs
- **Link** — Account-linking flows between patients and HIPs
- **Consent Flow** — Initiate, fetch, and notify consent artefacts
- **Data Flow** — Coordinate encrypted health-information transfers
- **Identification** — Resolve patient identifiers and ABHA IDs
- **Monitoring** — Heartbeat and audit endpoints for relying parties

## Why Jentic

- **Setup:** Wiring the NDHM Gateway by hand means signing JWTs, managing Gateway client credentials on the dev.ndhm.gov.in host, and handling the asynchronous discovery, consent, and data-flow callbacks yourself. Through Jentic you install once, import the Gateway from the API Directory, store the client credentials once, and your agent calls it.
- **Permission scoping:** The Gateway carries HIU id, purpose, and consent ids in the request body rather than in the URL path, so scope the agent to the operations it needs, such as initiating a consent request. You choose the operations it may call, so care-context discovery or consent-fetch calls are not included unless you add them.
- **Credential handling:** Your NDHM JWT signing keys and Gateway client credentials are stored once, encrypted, by your own Jentic One instance and injected at execution time. Private keys and raw tokens never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'initiate an NDHM consent request', and Jentic returns POST /v0.5/consent-requests/init with its input schema so the agent supplies HIU id and purpose without browsing the reference docs.

## Related APIs

- **NDHM Health Data Consent Manager** — The CM-facing counterpart of the Gateway - implements the patient-facing consent and account-linking flow.
- **NDHM Health ID Service** — Issues and manages the ABHA Health ID that the Gateway uses to identify patients.
- **NDHM HIP Specifications** — Defines the HIP-side endpoints that pair with Gateway HIP-facing operations.

## FAQ

### Why is there no official OpenAPI spec for Gateway?

NDHM does not publish a maintained OpenAPI specification - only Markdown reference docs and a deprecated apis.guru import. Jentic generates and maintains this spec so that AI agents and developers can call Gateway via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the NDHM Gateway use?

The Gateway uses signed JWTs issued through its OpenID-style flow. Clients fetch the public verification certificates from GET /v0.5/certs and validate Gateway-issued tokens against them. The OpenAPI spec leaves `securitySchemes` empty because authorisation is handled at the JWT layer rather than via standard HTTP schemes.

### Can I initiate a consent request through this API?

Yes. POST /v0.5/consent-requests/init starts a consent request as an HIU. The Consent Manager then prompts the patient and notifies the HIU via POST /v0.5/consents/hiu/notify when the artefact is ready, or your service can poll /v0.5/consent-requests/status.

### What are the rate limits for the NDHM Gateway?

NDHM does not publish hard rate limits in the spec. The sandbox at dev.ndhm.gov.in applies fair-use throttling appropriate for development and certification testing. Production rate limits depend on the client's onboarding tier with the National Health Authority.

### How do I discover patient care contexts through Jentic?

Search Jentic for 'discover NDHM care contexts', load the schema for POST /v0.5/care-contexts/discover, and execute with the patient's ABHA identifier. The Gateway broadcasts to registered HIPs and your callback URL receives /on-discover responses.

### Is the NDHM Gateway free to use?

Yes. The Gateway is operated by India's National Health Authority and is free for accredited HIUs, HIPs, and CMs. Production access requires onboarding and certification through the NHA.

### Can I limit what my agent is allowed to do with the NDHM Gateway API?

Yes. Because you run Jentic One yourself, your own rules decide which NDHM Gateway operations and credentials the agent may use. The Gateway carries the HIU id, purpose, and consent ids in the request body rather than the URL, so you can scope the agent to only the operations it needs, such as POST /v0.5/consent-requests/init to start a consent request. Care-context discovery (POST /v0.5/care-contexts/discover) and consent-fetch (POST /v0.5/consents/fetch) calls are not included unless you explicitly add them.
