---
title: "Generate backup codes"
method: POST
path: "/api/auth/totp/generate-backup-codes"
tags: ["TOTP Plugin"]
---

# Generate backup codes

`POST /api/auth/totp/generate-backup-codes`

Generates a new set of backup codes for the authenticated user. Previous backup codes are invalidated.

## Response `200`

OK

- GenerateBackupCodesResponse
  - `backup_codes` string[], required

## Changes

- **2026-07-08** `ee53eca042f6` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/authula/apis/authula-api/changes/api/auth/totp/generate-backup-codes/post.md)

---

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