Change the password

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

Changes the mailbox password. Every other session is signed out (the one making the call stays); mail apps need the new password.

Errors

Status When
401 No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login.
401 Current password is incorrect.
409 New password must be different from the current one.
422 The new password is too weak or too long.
429 Too many wrong current passwords.

Request body

  • current_passwordstringrequired

    The password in use now.

  • new_passwordstringrequired

    The new password. Must differ from the current one.

Request

POST/api/v1/mailbox/security/password
curl -X POST 'https://courier.mailyte.com/api/v1/mailbox/security/password' \
  -H 'Authorization: Bearer MAILBOX_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "current_password": "old-password",
    "new_password": "a-long-new-passphrase"
  }'

Response

Successful Response

  • dataobject
    • sessions_revokedinteger

      Other sessions signed out.

    • cache_flushedboolean
200application/json
{
  "type": "success",
  "msg": "Password changed",
  "data": {
    "sessions_revoked": 2,
    "cache_flushed": true
  }
}

Returned inside the standard envelope.

Errors

StatusWhen
401`Current password is incorrect`.
409`New password must be different from the current one`.
422The new password is too weak or too long.
429Too many wrong current passwords.
502The mail server could not be reached, so the password was not checked. Try again.

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