Tearleads

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

    totp for an authenticator code, recovery_code for a recovery code.

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

StatusMeaningBody
400Bad Request

application/jsonTwoFactorErrorResponse

401Unauthorized

application/jsonSessionFailureResponse

409Conflict

application/jsonTwoFactorErrorResponse

429Too Many Requests

application/jsonTwoFactorErrorResponse

500Internal Server Error

application/jsonErrorResponse

503Service Unavailable

application/jsonErrorResponse