---
title: "POST /api/user/2fa/totp/setup"
method: POST
path: "/api/user/2fa/totp/setup"
tags: ["user"]
---

# POST /api/user/2fa/totp/setup

`POST /api/user/2fa/totp/setup`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - API key in cookie `sessionid`

Start adding an authenticator app: a new secret, as text and QR code.

It protects nothing until confirmed with a code from the app. Starting
over replaces an unconfirmed secret.

## Request body

- AppNameRequest
  - `name` string

## Response `200`

- TwoFactorSetup
  - `secret` string, required: Base32, for typing into the app
  - `otpauthUrl` string, required
  - `qrCode` string, required: The otpauth URL as an SVG data URI

## Other responses

- `400`
- `401`
- `404`
- `405`
- `406`
- `415`
- `429`
- `500`

## Changes

- **2026-11-13** `7aaa5406d62c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/changes/api/user/2fa/totp/setup/post.md)

---

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