Skip to content

/mail/security/totp/recovery-codes

POST
/mail/security/totp/recovery-codes
curl --request POST \
--url https://example.com/api/v1/mail/security/totp/recovery-codes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "code": "example" }'

Replace the recovery codes with ten new ones, invalidating the old set. Requires a current authenticator code. The new codes are in the response and are never retrievable again.

Media typeapplication/json
object
code
required
string
/^\d{6}$/
Examplegenerated
{
"code": "example"
}

Default Response

Media typeapplication/json
object
totpEnabled
required
boolean
appPasswordsOnly
required
boolean
totpUnreadable
required
boolean
recoveryCodesRemaining
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
appPasswords
required
Array<object>
object
id
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
name
required
string
lastUsedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
recoveryCodes
required
Array<string>
Examplegenerated
{
"totpEnabled": true,
"appPasswordsOnly": true,
"totpUnreadable": true,
"recoveryCodesRemaining": 1,
"appPasswords": [
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"lastUsedAt": "2026-04-15T12:00:00Z",
"createdAt": "2026-04-15T12:00:00Z"
}
],
"recoveryCodes": [
"example"
]
}