---
title: "POST /users/me/mfa/setup"
method: POST
path: "/users/me/mfa/setup"
tags: ["Users"]
---

# POST /users/me/mfa/setup

`POST /users/me/mfa/setup`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/users/me/mfa/setup`
- Auth: HTTP bearer

## Request body

- SetupMfaRequest
  - `current_password` string, nullable: Required to enroll MFA on an account that has a password set. Omit (or leave empty) for SSO-only accounts with no local password.

## Response `200`

MFA setup data

- MfaSetupResponse
  - `qr_code` string, required
  - `recovery_codes` string[], required
  - `secret_key` string, required

## Other responses

- `400`: Current password is required but was not provided
- `401`: Unauthorized or current password is incorrect
- `403`: Caller is not a signed-in user session (API keys, CLI tokens and deployment tokens cannot manage MFA)
- `409`: MFA is already enabled; verify and disable it before re-enrollment
- `500`: Internal server error

## Changes

- **2026-10-13** `dd766bfd1f06`: 1 info
  - added the non-success response with the status `403`
- **2026-09-07** `943f7f929e7c`: 1 breaking, 1 info
  - added required request body
  - added the non-success response with the status `400`
- **2026-09-07** `5ab851bb63bf`: 1 info
  - added the non-success response with the status `409`
- **2026-09-07** `22543057a288`: 1 info
  - removed the non-success response with the status `409`
- **2026-09-07** `8be6c67df066`: 1 info
  - added the non-success response with the status `409`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/users/me/mfa/setup/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
