---
title: "Initialize authentication from HIP"
method: POST
path: "/v0.5/users/auth/init"
tags: ["Gateway"]
---

# Initialize authentication from HIP

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

This API is called by HIPs to initiate authentication of users. A transactionId is retuned by the corresponding callback API for confirmation of user auth.

## Headers

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

## Request body

- PatientAuthInitRequest
  - `query` object, required
    - `authMode` 'MOBILE_OTP' | 'DIRECT' | 'DEMOGRAPHICS' | 'AADHAAR_OTP' — Subjected to CM specific capability 1. MOBILE_OTP - for SMS OTP 2. DIRECT - for authentication directly with the patient. e.g. Mobile App, SMS 3. AADHAAR_OTP - for auth using OTP sent to Aadhaar number 4. DEMOGRAPHICS - for auth using demographic verification.
    - `id` string, required — id of the patient understood by the CM
    - `purpose` 'LINK' | 'KYC' | 'KYC_AND_LINK', required — what is the purpose of user auth
    - `requester` object, 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:** * patient id is not provided
- `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)
