---
title: "Identification result for a consent-manager user-id"
method: POST
path: "/v0.5/users/auth/on-fetch-modes"
tags: ["user auth", "cm facing"]
---

# Identification result for a consent-manager user-id

`POST /v0.5/users/auth/on-fetch-modes`

If a patient is found then **auth** attribute contains the supported modes for the specified purpose. 
Otherwise, error is raised for invalid requests or for non-existent id.
Note in addition to the "Authorization" header, one of the following headers must be specified
1. **X-HIU-ID** if the requester is HIU (identified from /auth/fetch-modes requester.id)
2. **X-HIP-ID** if the requester is HIP (identified from /auth/fetch-modes requester.id)

## Headers

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

## Request body

- PatientAuthModeQueryResponse
  - `auth` object
    - `modes` AuthenticationMode[], required
    - `purpose` 'LINK' | 'KYC' | 'KYC_AND_LINK', required — what is the purpose of user auth
  - `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` — Invalid request, required attributes 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)
