---
title: "POST /api/user/2fa/recovery-codes"
method: POST
path: "/api/user/2fa/recovery-codes"
tags: ["user"]
---

# POST /api/user/2fa/recovery-codes

`POST /api/user/2fa/recovery-codes`

## Request

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

Replace the recovery codes. Old ones stop working.

## Response `200`

- RecoveryCodes
  - `recoveryCodes` string[], required

## Other responses

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

## Changes

- **2026-11-13** `7aaa5406d62c`: 1 breaking, 2 info
  - removed the request body
  - removed `validation_error` mapping keys from the response discriminator for the response status `400`
  - removed `#/components/schemas/User2faRecoveryCodesCreateValidationError` from the response body `oneOf` list for the response status `400`
- **2026-11-13** `f930f1978e15`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/frikanalen/apis/frikanalen-django-api/changes/api/user/2fa/recovery-codes/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)
