---
title: "Generate recovery codes"
method: POST
path: "/admin/2fa/recoverycodes"
tags: ["admins"]
---

# Generate recovery codes

`POST /admin/2fa/recoverycodes`

Generates new recovery codes for the logged in admin. Generating new recovery codes you automatically invalidate old ones

## Response `200`

successful operation

- string[]

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `500` — Internal Server Error
- `default` — Unexpected Error

---

[API](https://skmtc.net/kanton-bern/apis/sftpgo.md) · [All operations](https://skmtc.net/kanton-bern/apis/sftpgo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kanton-bern/sftpgo/versions/d8d616a479b0/schema)
