---
title: "notification API in case of DIRECT mode of authentication by the CM"
method: POST
path: "/v0.5/users/auth/notify"
tags: ["user auth", "cm facing"]
---

# notification API in case of DIRECT mode of authentication by the CM

`POST /v0.5/users/auth/notify`

This API is called by CM to confirm authentication of users. The transactionId returned is same as that passed in /auth/on-init. The "auth.status" conveys whether the request was GRANTED or DENIED.

  1. **auth.accessToken** - is specific to the purpose mentioned in the /auth/init. This token needs to be used for initiating the intended action. For example for HIP initiated linking of care-contexts
  2. **NOTE**, only one of **X-HIP-ID** or **X-HIU-ID** will be sent as part of header, not both.
  3. The payload is conditional to the purpose of auth. If purpose specified in /auth/init is KYC or KYC_AND_LINK, then patient details are passed. **auth.accessToken** is passed only if the purpose is LINK or KYC_AND_LINK.

## Headers

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

## Request body

- PatientAuthNotification
  - `auth` object — depending on the purpose of auth, as specified in /auth/init, the response may include the following 1. LINK - only returns **accessToken** 2. KYC - only returns **patient** 3. KYC_AND_LINK - returns both **accessToken** and **patient**
    - `accessToken` string — access token for initialization of subsequent action.
    - `patient` PatientDemographicResponse
      - `address` PatientAddress
        - `district` string
        - `line` string
        - `pincode` string
        - `state` string
      - `gender` 'M' | 'F' | 'O' | 'U', required
      - `id` string, required — PHR Identifier of patient at consent manager
      - `identifiers` Identifier[]
        - `type` 'MOBILE' | 'MR' | 'NDHM_HEALTH_NUMBER' | 'HEALTH_ID'
        - `value` string
      - `name` string, required
      - `yearOfBirth` integer, required
    - `status` 'GRANTED' | 'DENIED', required
    - `transactionId` string, required — transaction id for auth session
    - `validity` AccessTokenValidity
      - `expiry` string, date-time, required — Date time format in UTC, includes miliseconds YYYY-MM-DDThh:mm:ss.vZ
      - `limit` integer, required — number of times, the token can be used
      - `purpose` 'LINK' | 'KYC' | 'KYC_AND_LINK', required — what is the purpose of user auth
      - `requester` PatientAuthRequester, required — identification of requester
        - `id` string, required
        - `type` 'HIP' | 'HIU', 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

- `400` — **Causes:** * required details not provided * neither auth nor error specified
- `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)
