---
title: "Starts two-factor authentication setup."
method: POST
path: "/api/users/me/2fa/enable"
tags: ["account"]
---

# Starts two-factor authentication setup.

`POST /api/users/me/2fa/enable`

## Request

- Base URL: `https://api.pricklymails.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pricklymails.com/api/users/me/2fa/enable`
- Auth: HTTP bearer

## Response `200`

TOTP secret, otpauth URI, and backup codes.

- Enable2FAResponse: Response body for `POST /api/users/me/2fa/enable`.
  - `backup_codes` string[], required: Single-use backup codes, shown only once.
  - `qr_uri` string, required: The `otpauth://` URI for QR code generation.
  - `secret` string, required: The base32-encoded TOTP secret.

## Other responses

- `401`: Missing or invalid JWT.
- `409`: 2FA is already enabled.

---

[API](https://skmtc.dev/pricklymails/apis/pricklymails-api.md) · [All operations](https://skmtc.dev/pricklymails/apis/pricklymails-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pricklymails/apis/pricklymails-api/revisions/b4225a92d8fb?raw)
