---
title: "Response to consent request"
method: POST
path: "/v0.5/consent-requests/on-init"
tags: ["consent flow", "cm facing"]
---

# Response to consent request

`POST /v0.5/consent-requests/on-init`

Result of consent request creation for a patient. **consentRequest.id** represents the consentrequest id created by CM. The result must contain either **consentRequest** or the **error** caused. <br/>
  Reasons for error may be
  * Invalid references (e.g patient id, hiu id), purpose, hiTypes, ranges, persmission

## Headers

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

## Request body

- ConsentRequestInitResponse
  - `consentRequest` object
    - `id` string, uuid, required — id of the consent-request created
  - `error` Error
    - `code` 1000 | 10001
    - `message` string
  - `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`

Request Accepted

## Other responses

- `400` — **Causes:** * Invalid data sent
- `401` — **Causes:** * Expired/Invalid token.
- `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/revisions/a440e2981b29/schema)
