Bulk-delete many mailbox messages in a single call
Permanently deletes up to 1000 mailbox messages named in messageIds in one call, removing each message and its stored bytes — the raw email plus every attachment.
Permanently deletes up to 1000 mailbox messages named in messageIds in one call, removing each message and its stored bytes — the raw email plus every attachment. Deletion is owner-scoped and partial-success: the response is { deleted: [...], failed: [{ id, error }] }, and a malformed, unknown, or foreign id lands in failed rather than aborting the batch. An empty messageIds, or more than 1000 ids, returns 400. This is irreversible and emits no webhook event; it requires the messages:read scope — the same scope that reads the mailbox, since the messages surface has no separate delete scope.
Scope: messages:read. Send the API key as a bearer token; Scopes lists what each one reaches.
Request
Body
Required, application/json: BatchDeleteMessagesRequest.
| Field | Type | Required | Description |
|---|---|---|---|
messageIds | array of string (uuid) | yes | The message ids to delete (1-1000). (min items 1, max items 1000) |
Response
200 Success. Body: application/json, BatchDeleteResult.
| Field | Type | Required | Description |
|---|---|---|---|
object | "batch_delete_result" | yes | |
deleted | array of string | yes | The ids that were successfully deleted. |
failed | array of object | yes | Per-id failures; never aborts the rest of the batch. |
Errors
Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.
| Status | Meaning |
|---|---|
400 | The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch). |
401 | The API key is missing or invalid. |
403 | The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted). |
422 | The request is well-formed but a field failed validation (validation_failed). |
429 | Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached). |
500 | An unexpected error; retry with backoff, then contact support (internal_error). |
Get a message by ID
Resolves a single message by messageId across the unified surface: an agent-to-agent receipt first, then the mailbox (an inbound message or an outbound copy), then the outbound send ledger — so any message id returns the right record.
Cancel a scheduled outbound message
Cancels a scheduled outbound send before it fires, by messageId.