---
title: "Generate new backup codes"
method: POST
path: "/users/totp/backup-codes"
tags: ["Users"]
---

# Generate new backup codes

`POST /users/totp/backup-codes`

Generates new TOTP backup codes.

## Request body

- object
  - `password` string
  - `totp_code` string

## Response `200`

New backup codes generated.

## Other responses

- `400` — Password or TOTP code is required.
- `401` — Incorrect password or invalid TOTP code.
- `404` — User not found.
- `500` — Failed to generate backup codes.

---

[API](https://skmtc.dev/termix/apis/termix-api.md) · [All operations](https://skmtc.dev/termix/apis/termix-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/termix/termix-api/revisions/f4ef343eff1b/schema)
