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.

Responses

  • 200 application/json

    Backup codes have been successfully generated.

    Hide response attributes Show response attributes 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 array[string] Required

      The generated backup codes.

  • Bad Request

  • The current interaction is not identified yet. All MFA verification records must be associated with a identified user.

POST /api/experience/verification/backup-code/generate
curl \
 -X POST https://[tenant_id].logto.app/api/experience/verification/backup-code/generate
Response examples (200)
{
  "verificationId": "string",
  "codes": [
    "string"
  ]
}