---
title: "callback API for HIP initiated patient linking /link/add-context"
method: POST
path: "/v0.5/links/link/on-add-contexts"
tags: ["link"]
---

# callback API for HIP initiated patient linking /link/add-context

`POST /v0.5/links/link/on-add-contexts`

If the accessToken is valid for purpose of linking, and specified details provided, CM will send "acknoweldgement.status" as SUCCESS. If any error occcurred, for example invalid token, or other required patient or care-context information not provided, then "error" attribute conveys so. 
  1. **accessToken must be valid and must be for the purpose of linking**

## Headers

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

## Request body

- PatientCareContextLinkResponse
  - `acknowledgement` object
    - `status` 'SUCCESS', required
  - `error` Error
    - `code` 1000 | 10001, required
    - `message` 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

## Response `202`

accepted

## Other responses

- `400` — **Causes:** * resp not specified * atleast acknowledgement or error should be specified
- `401` — **Causes:** * Unauthorized request
- `500` — **Causes:** * Downstream system(s) is down. * Unhandled exceptions.

---

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