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

# API for HIP initiated care-context linking for patient

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

API to submit care-context to CM for HIP initiated linking. The API must accompany the "accessToken" fetched in the users/auth process.  
  1. subsequent usage for accessToken may be invalid if it was meant for one-time usage or if it expired

## Headers

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

## Request body

- PatientCareContextLinkRequest
  - `link` PatientCareContextLink, required
    - `accessToken` string, required — AccessToken fetched in the user auth process for the purpose specified
    - `patient` object, required
      - `careContexts` CareContextRepresentation[], required
        - `display` string, required
        - `referenceNumber` string, required
      - `display` string, required
      - `referenceNumber` string, required — patient reference id at HIP
  - `requestId` string, uuid, required — a nonce, unique for each HTTP request
  - `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:** * required information 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)
