---
title: "Regenerate 2Fa Recovery Codes"
method: POST
path: "/auth/2fa/recovery-codes"
tags: ["internal"]
---

# Regenerate 2Fa Recovery Codes

`POST /auth/2fa/recovery-codes`

## Request

- Base URL: `https://api.companydata.dk` (the document declares no server; this is the origin it was published from)
- URL: `https://api.companydata.dk/auth/2fa/recovery-codes`
- Auth: HTTP bearer

Generate new recovery codes.

Requires a valid TOTP code. Old recovery codes will be invalidated.

## Request body

- TwoFactorVerifyRequest: Request to verify 2FA setup or code.
  - `code` string, required

## Response `200`

Successful Response

- TwoFactorRecoveryCodesResponse: Response with new recovery codes.
  - `recovery_codes` string[], required

## Other responses

- `422`: Validation Error

---

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