Bulk Update (email account)

POST/api/v1/email-accounts/bulk-update
Requires anorganization API keywith the scopemailboxes:write

Request body

  • account_idsarray<string>required

    IDs of the mailboxes to act on. Read them from GET /email-accounts.

  • actionstringrequiredsuspend | activate | delete

    What to do to every mailbox in account_ids.

  • settingsobject

    Optional. Settings to apply with the action.

    • storage_quota_mbinteger

      Optional. This mailbox's storage, in megabytes.

    • statusstringactive | suspended

      active or suspended.

Request

POST/api/v1/email-accounts/bulk-update
curl -X POST 'https://app.mailyte.com/api/v1/email-accounts/bulk-update' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "account_ids": [
      "01JBT8XQ2M9WYC3K4F6R7S8T9V"
    ],
    "action": "suspend"
  }'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • objectstringmailbox_bulk_result
    • updatedinteger

      How many mailboxes were changed.

    • failedinteger

      How many were not. **A bulk update is not atomic**: a 200 with failed above zero means part of your batch did not happen, so check this rather than the status code.

    • errorsarray<object>

      One entry per failure, and the only place the failures are named. Empty when failed is 0.

      • mailbox_idstring

        The ID of the mailbox that failed, as you sent it in account_ids.

      • messagestring

        Why that mailbox was not updated, for a person to read. Do not match on the text.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

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