Skip to content
machinemail

Export

Inbox export.

MethodPathSummary
GET/v0/inboxes/{inbox_id}/exportExport Inbox
GET/v0/pods/{pod_id}/inboxes/{inbox_id}/exportExport Inbox in Pod

Export Inbox

http
GET /v0/inboxes/{inbox_id}/export

Every message in the inbox, oldest first, streamed as an attachment named <inbox_id>.<format>.

Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_read.

Path parameters

inbox_idstringRequired
ID of the inbox: its email address, as in AgentMail (inbox_id == email).

Query parameters

format"mbox" | "jsonl"
mbox: every message as raw MIME in one mbox file. jsonl: one Message JSON object per line.

Default"mbox"

Response

200 The export (application/mbox, application/x-ndjson)

Headers:

Content-Dispositionstring
attachment; filename="<inbox_id>.<format>"

Errors

StatusMeaning
400Invalid request: error.type is validation and error.param names the field.
401Missing, invalid, expired or revoked credential.
403The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register).
404Not found. Also returned for resources outside the credential scope.
500Unexpected server error.

Error bodies use the error envelope.

Example

Request
curl "https://api.machinemail.dev/v0/inboxes/agent@machinemail.dev/export" \
  -H "Authorization: Bearer $MACHINEMAIL_API_KEY"

Export Inbox in Pod

http
GET /v0/pods/{pod_id}/inboxes/{inbox_id}/export

Same as Export Inbox (GET /v0/inboxes/{inbox_id}/export), limited to the pod.

Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: message_read.

Path parameters

pod_idstringRequired
ID of the pod.
inbox_idstringRequired
ID of the inbox: its email address, as in AgentMail (inbox_id == email).

Query parameters

format"mbox" | "jsonl"
mbox: every message as raw MIME in one mbox file. jsonl: one Message JSON object per line.

Default"mbox"

Response

200 The export (application/mbox, application/x-ndjson)

Headers:

Content-Dispositionstring
attachment; filename="<inbox_id>.<format>"

Errors

StatusMeaning
400Invalid request: error.type is validation and error.param names the field.
401Missing, invalid, expired or revoked credential.
403The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register).
404Not found. Also returned for resources outside the credential scope.
500Unexpected server error.

Error bodies use the error envelope.

Example

Request
curl "https://api.machinemail.dev/v0/pods/pod_01k6x2m9qd0001b8j4mr0w3d5f/inboxes/agent@machinemail.dev/export" \
  -H "Authorization: Bearer $MACHINEMAIL_API_KEY"

On this page

0% read