---
title: "Response to patient's care context link request"
method: POST
path: "/v0.5/links/link/on-init"
tags: ["link", "hip facing"]
---

# Response to patient's care context link request

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

Result of patient care-context link request from HIP end. This happens in context of previous discovery of patient found at HIP end, therefore the link requests ought to be in reference to the patient reference and care-context references previously returned by the HIP. The correlation of discovery and link request is maintained through the transactionId. HIP should have
  1. **Validated transactionId in the request to check whether there was a discovery done previously, and the link request corresponds to returned patient care care context references**
  2. **Before returning the response, HIP should have sent an authentication request to the patient(eg: OTP verification)**
  3. **HIP should communicate the mode of authentication of a successful request**
  4. **HIP subsequently should expect the token passed via /link/confirm against the link.referenceNumber passed in this call**




















  
The error section in the body, represents the potential errors that may have occurred. Possible reasons:
  1. **Patient reference number is invalid**
  2. **Care context reference numbers are invalid**

## Headers

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

## Request body

- PatientLinkReferenceResult
  - `error` Error
    - `code` 1000 | 10001
    - `message` string
  - `link` object
    - `authenticationType` 'DIRECT' | 'MEDIATED', required
    - `meta` Meta
      - `communicationExpiry` string
      - `communicationHint` string
      - `communicationMedium` 'MOBILE' | 'EMAIL'
    - `referenceNumber` string, required
  - `requestId` string, uuid, required — a nonce, unique for each HTTP request
  - `resp` RequestReference, required
    - `requestId` string, uuid, required — the requestId that was passed
  - `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:** * Format mismatch of any of attributes.
- `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)
