The Open API specification for Synapse is now available for download!

Download Open API Spec

POST /2fa/recoveryCodes

Generates a new set of single use recovery codes that are associated with the two factor authentication of the user. The recovery codes are single use and can be used to login with 2FA in place of an TOTP. In order to use a recovery code the body of the login request should specify as the otpType RECOVERY_CODE and the otpCode should match one of the generated recovery codes.

Note that invoking this endpoint will replace existing recovery codes.

Resource URL

Resource Information
Authentication Required
Required OAuth Scopes modify , authorize
Request Object None
Response Object TwoFactorAuthRecoveryCodes