Turn two-factor on

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

Confirms setup with the current code from the authenticator app. From then on, sign-in needs a code.

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 or expired.

Request body

  • codestringrequired

    The current 6-digit code from the authenticator app.

Request

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

Response

Successful Response

  • dataobject
    • two_factor_enabledboolean
    • two_factor_confirmed_atstring
200application/json
{
  "type": "success",
  "msg": "Two-factor authentication enabled",
  "data": {
    "two_factor_enabled": true,
    "two_factor_confirmed_at": "2026-10-11T12:00:00+00:00"
  }
}

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 or expired.

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