Docs Developers Sign in ← Site
Docs / Agent Mail

Agent Mail API

Base URL https://app.cloudbox.biz. Authenticate with your CloudBox API key: Authorization: Bearer cbs_.... Write actions need a key with the write scope.

Inboxes

POST/api/v1/mail/inboxes

Create an inbox. Body: {"name": "billing-bot", "domain": "agents.cloudbox.biz"} (both optional).

GET/api/v1/mail/inboxes
GET/api/v1/mail/inboxes/{inbox_id}
PATCH/api/v1/mail/inboxes/{inbox_id}

Update display_name, mode (open|allowlist|blocklist), allow_list/block_list (newline-separated addresses or @domain), retention_days, or status.

DELETE/api/v1/mail/inboxes/{inbox_id}

Messages

GET/api/v1/mail/inboxes/{inbox_id}/messages

Query: limit (≤100), before, q, unread=1, direction=in|out.

GET/api/v1/mail/inboxes/{inbox_id}/messages/wait

Long-poll - see Webhooks & waiting.

GET/api/v1/mail/messages/{message_id}
GET/api/v1/mail/messages/{message_id}/raw
GET/api/v1/mail/messages/{message_id}/attachments/{n}
POST/api/v1/mail/messages/{message_id}/read
POST/api/v1/mail/inboxes/{inbox_id}/messages/send

Body: to (string or array), cc, bcc, subject, text, html. Send an Idempotency-Key header to make retries safe.

POST/api/v1/mail/messages/{message_id}/reply

Body: text, html, all (reply-all). Threading headers are set for you.

POST/api/v1/mail/messages/{message_id}/forward

Threads & usage

GET/api/v1/mail/inboxes/{inbox_id}/threads
GET/api/v1/mail/threads/{thread_key}
GET/api/v1/mail/usage

Returns this month's inbox count, message counts and your plan caps.

A message object

{
  "message_id": "msg_9f2c...",
  "thread_key": "msg_9f2c...",
  "direction": "in",
  "from": "ap@acme.com",
  "to": ["billing-bot@agents.cloudbox.biz"],
  "subject": "Invoice 4821",
  "snippet": "Please find attached...",
  "text": "Please find attached...",
  "attachments": [{"filename": "invoice.pdf", "size": 48213, "content_type": "application/pdf"}],
  "is_read": false,
  "created": "2026-08-02T10:14:00Z"
}
NoteErrors follow the Storage API shape: 401 unauthorized, 403 scope/forbidden, 404 not found, 422 validation, 429 quota/inbox cap. See Errors & limits.