---
title: "Link patient's care contexts"
method: POST
path: "/v0.5/links/link/init"
tags: ["link", "cm facing"]
---

# Link patient's care contexts

`POST /v0.5/links/link/init`

Request from CM to links care contexts associated with only one patient
  1. **Validate account reference number and care context reference number**
  2. **Validate transactionId in the request with discovery request entry to check whether there was a discovery
      and were these care contexts discovered or not for a given patient**
  3. **Before eventual link confirmation, HIP needs to authenticate the request with the patient(eg: OTP verification)**
  4. **HIP should communicate the mode of authentication of a successful request to Consent Manager**

## Headers

- `Authorization` string, required
- `X-HIP-ID` string, required

## Request body

- PatientLinkReferenceRequest
  - `patient` object, required
    - `careContexts` CareContext[], required
      - `referenceNumber` string, required
    - `id` string, required — Identifier of patient at consent manager
    - `referenceNumber` string, required
  - `requestId` string, uuid, required
  - `timestamp` string, date-time, required — Date time format in UTC, includes miliseconds YYYY-MM-DDThh:mm:ss.vZ
  - `transactionId` string, uuid, required

## Response `202`

Request accepted

## Other responses

- `400` — **Causes:** * Consent manager user id is not provided * Patient reference number is not provided * Care context references are not provided
- `401` — **Causes:** * Unauthorized request
- `500` — **Causes:** * Downstream system(s) is down. * Unhandled exceptions.

---

[API](https://skmtc.net/ndhm/apis/ndhm-gateway.md) · [All operations](https://skmtc.net/ndhm/apis/ndhm-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ndhm/ndhm-gateway/versions/a440e2981b29/schema)
