---
title: "Initiate 2Fa"
method: POST
path: "/api/v1/auth/2fa/initiate"
tags: ["Two-Factor Authentication"]
---

# Initiate 2Fa

`POST /api/v1/auth/2fa/initiate`

## Request

- Base URL: `https://app.perlucem.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.perlucem.ai/api/v1/auth/2fa/initiate`
- Auth: none declared

Initiate 2FA after successful password authentication.

Process:
1. Verify Cognito tokens
2. Check if device is trusted
3. If trusted, return tokens immediately
4. If not trusted, send SMS and return session token

## Request body

- TwoFAInitiateRequest: Request to initiate 2FA after password auth.
  - `cognito_id_token` string, required
  - `cognito_access_token` string, required
  - `device_fingerprint` string, nullable

## Response `200`

Successful Response

- TwoFAInitiateResponse: Response from 2FA initiation.
  - `requires_2fa` boolean, required
  - `requires_phone_setup` boolean
  - `session_token` string, nullable
  - `phone_masked` string, nullable
  - `trusted_device` boolean
  - `id_token` string, nullable
  - `access_token` string, nullable
  - `error` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/perlucem/apis/perlucem-ai-backend.md) · [All operations](https://skmtc.dev/perlucem/apis/perlucem-ai-backend/llms.txt) · [OpenAPI document](https://skmtc.dev/perlucem/apis/perlucem-ai-backend/revisions/e1830fb27394?raw)
