Disable 2FA via Email

Prev Next
Post
/api/v1/users.2fa.disableEmail

Disable two-factor authentication via email. The 2FA code is required.

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

X-User-Id
stringRequired

The userId of the authenticated user.

X-2fa-Code
stringRequired

The 2FA code.

X-2fa-method
stringRequired

The 2FA method. It can be email, totp, or password.

Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

TOTP Required

The 2FA code is passed as the X-2fa-Code query parameter.

It's important to note the required TOTP method returned from the response.

  • If it's password, add the hashed password of the user as the X-2fa-Code header parameter.
  • If it's email, add the 2FA code sent via email as the X-2fa-Code header parameter.
  • If it's totp, add the code from your authenticator app as the X-2fa-Code header parameter.
TOTP Required
{
  "success": false,
  "error": "TOTP Required [totp-required]",
  "errorType": "totp-required",
  "details": {
    "method": "password",
    "codeGenerated": false,
    "availableMethods": []
  }
}
Expand All
object
success
boolean
error
string
errorType
string
details
object
method
string
codeGenerated
boolean
availableMethods
Array of object
object