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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Your current password. It’s asked for again so that someone using your session can’t make this change without it.
object
Responses
Section titled “ Responses ”Your new recovery codes, shown this once.
object
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}