POST/auth/two-factor/recovery-codes
Replace two-factor recovery codes
Operation auth.twoFactor.recoveryCodes
Description
Replaces every recovery code with ten new ones after checking an authenticator or recovery code. The old codes stop working at once; the new ones are shown only in this response.
Authentication
Requires a signed-in session: the client sends its session token as a bearer token in the Authorization header.
Request body
application/jsonTwoFactorConfirmationRequest
Proves the second factor again before turning it off or replacing the recovery codes.
2 fields
codestringrequired- 1 to 32 characters
An authenticator code or an unused recovery code.
methodstringrequired- one of
totp,recovery_code
totpfor an authenticator code,recovery_codefor a recovery code.- one of
Other fields are allowed.
Responses
200 OK
application/jsonTwoFactorRecoveryCodesResponse
New recovery codes, shown once; the previous codes no longer work.
1 field
recoveryCodeslist of stringrequired- each item: not empty
Other fields are allowed.
Other responses
| Status | Meaning | Body |
|---|---|---|
| 400 | Bad Request |
|
| 401 | Unauthorized |
|
| 409 | Conflict |
|
| 429 | Too Many Requests |
|
| 500 | Internal Server Error |
|
| 503 | Service Unavailable |
|