National Health Authority

Command Palette

Search for a command to run...

Records & Consents

Discover records from a PHR app, support deep links, manage consent, and upload records to a locker.

A PHR app lets the patient discover, link, fetch, view, and upload health records. It also lets the patient manage consent requests from HIUs.

Use this page for the PHR-side flow. Use Milestone 2 for the HIP-side discovery and data transfer logic.

Confirm exact schemas

The source has OCR for some API screenshots. The examples below use the referenced v3 Swagger paths. Verify the exact payload before sandbox exit.

User-initiated discovery

Use user-initiated discovery when the patient did not share an ABHA address at the facility. The patient searches a facility or a health programme. The PHR app sends the patient identifiers to HIE-CM. HIE-CM forwards the request to the HIP.

sequenceDiagram
  participant Patient
  participant App as PHR app
  participant CM as HIE-CM
  participant HIP
  Patient->>App: Search facility or programme
  App->>CM: POST patient/care-context/discover
  CM->>HIP: POST callback /patient/care-context/discover
  HIP-->>CM: POST on-discover
  CM-->>App: POST callback /patient/care-context/on-discover
  Patient->>App: Select care context entries
  App->>CM: POST link/care-context/init
  CM->>HIP: POST callback /link/care-context/init
  HIP-->>Patient: Send OTP
  Patient->>App: Enter OTP
  App->>CM: POST link/care-context/confirm
  CM->>HIP: POST callback /link/care-context/confirm
  HIP-->>CM: POST on-confirm
  CM-->>App: Link success

Search the provider

Let the patient search an ABDM-compliant facility or programme. Examples include CoWIN, AB-PMJAY, eSanjeevani OPD, eSanjeevani HWC, and RCH.

Show patient details

Show the details that the PHR app will share. Ask for an optional patient ID only when the provider needs it.

FieldRequired
Verified mobile numberYes
ABHA addressYes
ABHA numberIf available
Full nameYes
Year of birthYes
GenderYes
Patient ID or programme IDOptional

Discover care context entries

Discover care context entries
curl -X POST "https://dev.abdm.gov.in/api/hiecm/user-initiated-linking/v3/patient/care-context/discover" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "hip": {
      "id": "HIP_1"
    },
    "unverifiedIdentifiers": [
      {
        "type": "ABHA_ADDRESS",
        "value": "john.doe@sbx"
      },
      {
        "type": "MOBILE",
        "value": "9876543210"
      },
      {
        "type": "MR",
        "value": "123456"
      }
    ]
  }'
Response (202)
{
  "status": "ACCEPTED"
}

Show only unlinked care context entries. If all records already link, show a clear message.

Initiate linking
curl -X POST "https://dev.abdm.gov.in/api/hiecm/user-initiated-linking/v3/link/care-context/init" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "transactionId": "2ec11b33-9a2d-4c8a-96a0-4b0d1fd5f511",
    "patient": [
      {
        "referenceNumber": "P12345",
        "display": "John Doe",
        "careContexts": [
          {
            "referenceNumber": "VISIT-2026-001",
            "display": "OP visit on 11 Aug 2026"
          }
        ],
        "hiType": "OPConsultation",
        "count": 1
      }
    ]
  }'
Response (202)
{
  "linkRefNumber": "link-ref-123",
  "status": "INITIATED"
}

Confirm with OTP

The HIP sends the OTP to the patient mobile number. Confirm the link with the token and link reference.

Confirm linking
curl -X POST "https://dev.abdm.gov.in/api/hiecm/user-initiated-linking/v3/link/care-context/confirm" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "token": 123456,
    "linkRefNumber": "link-ref-123"
  }'
Response (202)
{
  "status": "ACCEPTED"
}

Discovery error states

StateMessage to show
HIP not reachable“Could not connect. Please try again later.”
No match“No health records found.”
All records linked“No new health record to link.”
Fetch takes time“Recently linked records might take some time to show.”

After a successful link, show the provider in the Linked Facility tab. Send the data transfer request within 5 minutes after the patient taps Pull Records. Expect fetched records to appear within 2 hours.

A facility can notify ABDM when it creates a record for a patient without an ABHA address. ABDM sends an SMS with a deep link such as phr.abdm.gov.in/uhi/<hipcode>. The deep link page lists approved PHR apps.

The PHR app must receive the HIPCODE parameter. It must bypass the normal home flow and start discovery automatically.

New user flow

Show the approved PHR app list for the phone operating system. Randomize the app order as ABDM requires.

Install and register

Route the patient to the store if the selected app is not installed. After install, help the patient create an ABHA address.

Start discovery

Start discovery with the HIPCODE from the deep link. Ask the patient to enter the same name, DOB, gender, and mobile number used at the facility.

Existing user flow

Launch the app

Open the installed PHR app from the deep link.

Authenticate if required

Ask for login if the patient session expired.

Start discovery

Use the HIPCODE and show matched care context entries. Then let the patient link and fetch records.

Sandbox exit details

Submit these details for deep link support:

Required detailExample
Application nameAarogya Setu
Play Store URLhttps://play.google.com/store/apps/details?id=nic.goi.aarogyasetu
App Store URLhttps://apps.apple.com/in/app/aarogyasetu/id1505825357
HIPCODE supportThe app must parse and process the HIPCODE parameter.

The PHR app is the patient interface for consent. It must support view, modify, grant, deny, active consent view, and revoke.

flowchart TD
  A[Consent request received] --> B[Show request to patient]
  B --> C{Patient action}
  C -->|Modify| D[Update parameters]
  D --> C
  C -->|Grant| E[Approve request]
  C -->|Deny| F[Deny request]
  E --> G[Show in active consents]
  G --> H[Revoke when patient asks]
  H --> I[Update HIE-CM status]

Show the requester, purpose, HI types, date range, consent validity, and status.

Fetch patient consent requests
curl -X GET "https://dev.abdm.gov.in/api/hiecm/consent/v3/request" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>"
Response
{
  "requests": [
    {
      "requestId": "consent-req-123",
      "status": "REQUESTED",
      "purpose": "Care Management",
      "hiTypes": ["DiagnosticReport", "Prescription"]
    }
  ]
}

Modify before grant

Allow changes only where the request permits them. Let the patient adjust the date range, HI types, frequency, expiry, and access mode.

Approve consent request
curl -X POST "https://dev.abdm.gov.in/api/hiecm/consent/v3/request/<request-id>/approve" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "consents": [
      {
        "hiTypes": ["DiagnosticReport", "Prescription"],
        "hip": {
          "id": "HIP_1",
          "name": "Example Hospital",
          "type": "HIP"
        },
        "careContexts": [
          {
            "patientReference": "P12345",
            "careContextReference": "VISIT-2026-001"
          }
        ],
        "permission": {
          "dateRange": {
            "from": "2026-01-01T00:00:00.000Z",
            "to": "2026-08-11T00:00:00.000Z"
          },
          "frequency": {
            "unit": "HOUR",
            "value": 1,
            "repeats": 0
          },
          "accessMode": "VIEW",
          "dataEraseAt": "2026-09-11T00:00:00.000Z"
        }
      }
    ]
  }'
Response (202)
{
  "status": "ACCEPTED"
}
Deny consent request
curl -X POST "https://dev.abdm.gov.in/api/hiecm/consent/v3/request/<request-id>/deny" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "reason": "Patient denied the consent request"
  }'
Response (202)
{
  "status": "ACCEPTED"
}

View active consents

Show granted, expired, and revoked consents in the Approved section. Show which HIU can access which records.

Warn the patient before revocation. Tell the patient that ABDM access will stop.

Revoke consent
curl -X POST "https://dev.abdm.gov.in/api/hiecm/consent/v3/revoke" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "consents": ["consent-artefact-123"]
  }'
Response (202)
{
  "status": "ACCEPTED"
}

Fetch and display records

A PHR app also acts as an HIU. After a care context link, create a consent request. Use auto-approve if the patient configured it. Then fetch records with the approved consent artefact.

StepRequirement
NotificationReceive the new care context notification.
ConsentCreate a consent request for the linked record.
FetchInitiate a health information request.
StoreStore the fetched record securely.
DisplayShow records in chronological order.
PurgeFollow ABDM privacy and consent rules.

See Milestone 3 for the HIU data request flow.

Upload records to a locker

The PHR app must let the patient scan or upload records. Examples include paper records, BP meter output, glucose meter output, and smartwatch records.

Use the selected or detected HI type. Use HealthDocumentRecord when the app cannot identify the HI type.

The PHR app must get a linking token for the ABHA address. Then it must add the uploaded item as a care context through HIP initiated linking. See Milestone 1 for linking tokens. Use Milestone 2 to share uploaded records through ABDM.

Set up health locker
curl -X POST "https://dev.abdm.gov.in/api/hiecm/subscription-requests/v3/setup-locker" \
  -H "Content-Type: application/json" \
  -H "REQUEST-ID: $(uuidgen | tr 'A-Z' 'a-z')" \
  -H "TIMESTAMP: $(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
  -H "X-CM-ID: sbx" \
  -H "Authorization: Bearer <hiecm-access-token>" \
  -d '{
    "patient": {
      "id": "john.doe@sbx"
    },
    "locker": {
      "id": "PHR_LOCKER_ID",
      "name": "Example PHR Locker"
    }
  }'
Response
{
  "lockerId": "PHR_LOCKER_ID",
  "status": "ACTIVE"
}

Locker setup body is uncertain

The archived source shows only the locker endpoint path. Treat this request body as an implementation sketch. Use the latest subscription Swagger for the exact body.

Upload UX checks

CheckRequirement
File typeAccept JPG, PNG, and PDF.
File sizeKeep each file within 10 MB.
Page limitKeep each file within 40 pages.
OwnershipTell the patient to upload only their own medical documents.
PreviewShow the original document and extracted data.
ConsentAsk for consent before AI-assisted processing.
CompletionConfirm when the report joins the smart report view.

Sources

  • ABDM PHR app documentation (DOCX→MD, 2026-08)