---
title: "Consent notification"
method: POST
path: "/v0.5/consents/hip/notify"
tags: ["consent flow", "cm facing"]
---

# Consent notification

`POST /v0.5/consents/hip/notify`

Notification of consents to health information providers consent request granted, consent revoked, consent expired. Only the GRANTED, REVOKED and EXPIRED status notifications will be sent to HIP.
  1. If consent is granted, status=GRANTED, then consentDetail contains the consent artefact details and signature is available. 
  2. If consent is revoked, then status=REVOKED, and consentId specifes which consent artefact is revoked. 
  3. If the consent has expired, then status=EXPIRED, and consentId specifies which consent artefact has expired. Note, this is also responsibility of the HIP to keep track of consent expiry. Any data request on expired consent artefact must not be done.

## Headers

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

## Request body

- HIPConsentNotification
  - `notification` object, required
    - `consentDetail` object, required
      - `careContexts` object[], required
        - `careContextReference` string, required
        - `patientReference` string, required
      - `consentId` string, uuid, required
      - `consentManager` object, required
        - `id` string, required
      - `createdAt` string, date-time, required
      - `hiTypes` HITypeEnum[], required
      - `hip` object, required
        - `id` string, required
      - `patient` ConsentManagerPatientID, required
        - `id` string, <user-id>@ndhm
      - `permission` Permission, required
        - `accessMode` 'VIEW' | 'STORE' | 'QUERY' | 'STREAM', required
        - `dataEraseAt` string, date-time, required
        - `dateRange` object, required
          - `from` string, date-time
          - `to` string, date-time
        - `frequency` object, required
          - `repeats` integer
          - `unit` 'HOUR' | 'WEEK' | 'DAY' | 'MONTH' | 'YEAR'
          - `value` integer
      - `purpose` UsePurpose, required
        - `code` string, required — From the fixed set, documented at refUri
        - `refUri` string, uri
        - `text` string, required
      - `schemaVersion` string, string
    - `consentId` string, uuid, required
    - `signature` string, required
    - `status` 'GRANTED' | 'EXPIRED' | 'DENIED' | 'REQUESTED' | 'REVOKED', required
  - `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`

Request Accepted

## Other responses

- `401` — **Causes:** * Invalid/Expired/Empty token.
- `500` — **Causes:** * Downstream services are down

---

[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)
