---
title: "Initiate MFA Setup"
method: POST
path: "/v1/users/{id}/mfa/setup"
tags: ["MFA API"]
---

# Initiate MFA Setup

`POST /v1/users/{id}/mfa/setup`

Use this endpoint to initiate MFA setup for a user. Returns a secret and recovery codes to be stored by the user before verification.

## Path parameters

- `id` string, required

## Request body

- MFASetupInput — Information required to initiate MFA setup for a user.
  - `mfaType` 'app' | 'email' | 'sms', required — The type of MFA to configure.

## Response `200`

MFA setup initiated successfully. Store the secret and recovery codes before proceeding to verification.

- MFASetupResponse — The result of an MFA setup initiation, including the secret and recovery codes.
  - `secret` string — TOTP secret to be stored securely by the user or app.
  - `url` string — OTP Auth URL for QR code generation (TOTP only).
  - `recoveryCodes` string[] — One-time recovery codes to be stored by the user.
  - `mfaType` 'app' | 'email' | 'sms' — The MFA type that was configured.
  - `enabled` boolean — Indicates whether MFA is currently enabled.

## Other responses

- `400`
- `404`
- `500`

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
