Skip to content

Make new recovery codes

POST
/account/security/2fa/recovery/regenerate

Replaces your recovery codes with ten new ones and returns them. Every old code stops working, used or not. Send your current password; a wrong one, or an account with no password of its own, gets a 400.

The new codes are shown only in this response, so save them right away. If saving them fails you get a 500, and your old codes are normally kept.

This doesn’t check that two-factor authentication is on, and it doesn’t ask for an app code. Codes made while it’s off aren’t used at sign-in, and confirming a new setup replaces them. An API token works here as well as the session cookie.

Your current password. It’s asked for again so that someone using your session can’t make this change without it.

object
current_password
required
string format: password

Your new recovery codes, shown this once.

object
recovery_codes
required
Array<string>

Malformed request

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}