MailboxesReconnect mailboxes in a batch

Reconnect mailboxes in a batch

Queues one reconnect batch for mailboxes whose status is suspended, failed or error — the same check as the dashboard's Reconnect. The sending-worker re-verifies each mailbox from its sending IP (SMTP login, or OAuth token refresh + SMTP for Gmail/Outlook):

  • passed → status active, sending re-enabled, error fields cleared.
  • failed → status error with lastError set. Mailboxes are never deleted.

Select with mailboxIds, or omit it to take every mailbox in the workspace matching status (default: all three). status also narrows mailboxIds; listed mailboxes in other statuses come back in skipped. At most 500 mailboxes per batch — larger selections are rejected with BATCH_TOO_LARGE, not split.

Not reconnected:

  • Mailboxes suspended because the workspace owner's subscription lapsed. They're restored automatically once the subscription is renewed. Listed in skipped when selected by ID, and counted in billingSuspendedSkipped.
  • Mailboxes already in a reconnect batch that is still pending or processing. They come back in skipped with that batchId. If nothing else is left to queue, the request fails with 409 ALREADY_IN_PROGRESS and the running batch IDs, so retrying can't pile up logins against the mail provider.

Poll GET /v1/mailboxes/reconnect/{batchId} for progress.

curl -X POST "https://api.sendkit.ai/v1/mailboxes/reconnect" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -d '{
  "status": [
    "suspended",
    "failed"
  ]
}'
{
  "success": true,
  "data": {
    "batchId": "smtp_reconnect_test_1761200000000_k3j9x2a",
    "status": "pending",
    "queuedCount": 1,
    "skippedCount": 1,
    "notFoundCount": 0,
    "billingSuspendedSkipped": 0,
    "queued": [
      {
        "id": "665f1c2e9b1e8a0012345678",
        "email": "sam@acme.com",
        "status": "suspended"
      }
    ],
    "skipped": [
      {
        "id": "665f1c2e9b1e8a0012345679",
        "email": "alex@acme.com",
        "reason": "Skipped — status is active"
      }
    ],
    "notFound": []
  }
}
POST
/v1/mailboxes/reconnect
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-Api-Key)
X-Api-Keystring
Required

Platform API key (sk_user_...) or Workspace API key (sk_...)

Platform API key (sk_user_...) or Workspace API key (sk_...)
Content-Typestring
Required

The media type of the request body

Options: application/json
statusarray

Statuses to reconnect. Defaults to all three.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-Api-Keystring
Required

API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)

Body

application/json
statusarray

Statuses to reconnect. Defaults to all three.

Responses