Turn two-factor off

POST/api/v1/mailbox/security/2fa/disable
Requires amailbox token— it acts as one mailbox holder, not as the organization.

Needs a current code (or a recovery code), so a stolen session alone cannot turn it off.

Errors

Status When
401 No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login.
403 The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required.
422 The code is wrong.

Request body

  • codestringrequired

    A current code, or a recovery code.

Request

POST/api/v1/mailbox/security/2fa/disable
curl -X POST 'https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable' \
  -H 'Authorization: Bearer MAILBOX_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "492039"
  }'

Response

Successful Response

  • dataobject
    • two_factor_enabledboolean
200application/json
{
  "type": "success",
  "msg": "Two-factor authentication disabled",
  "data": {
    "two_factor_enabled": false
  }
}

Returned inside the standard envelope.

Errors

StatusWhen
401No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`.
403The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`.
422The code is wrong.

Every status, with what causes it and what to do, is on the error reference.