---
title: "Generate backup codes"
method: POST
path: "/api/experience/verification/backup-code/generate"
tags: ["Experience"]
---

# Generate backup codes

`POST /api/experience/verification/backup-code/generate`

Create a new BackupCode verification record with new backup codes generated. This verification record will be used to bind the backup codes to the user's profile.

## Response `200`

Backup codes have been successfully generated.

- object
  - `verificationId` string, required — The unique verification ID of the newly created BackupCode verification record. This ID is required when adding the backup codes to the user profile via the Profile API.
  - `codes` string[], required — The generated backup codes.

## Other responses

- `400` — Bad Request
- `404` — The current interaction is not identified yet. All MFA verification records must be associated with a identified user.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
