Questions · Updated 2026-09-27

How do I export my email data?

Export your email data with GET /account/export, which returns everything the account owns as a zip with emails.csv, suppressions.csv and domains.json. GET /emails/export.csv exports the message log with the list filters, and GET /emails/{id}/mime returns one message's exact source.

Export your email data with GET /account/export. Its summary is "Everything this account owns, as a zip: emails.csv (inside your retention window), suppressions.csv and domains.json. No job, no wait." For the message log alone, GET /emails/export.csv takes every filter GET /emails takes. For one message, GET /emails/{id}/mime returns its exact RFC 5322 source, and GET /emails/{id}/eml downloads it as a file.

The whole account

One request, one zip. emails.csv holds the messages still inside the retention window, so the file cannot contain what has already been purged; How long does AgentiSend keep my emails? says what that window is and where its figures are published. suppressions.csv is every row GET /suppressions would list, and domains.json is your sending domains.

curl -sS -X GET https://api.agentisend.com/account/export \
  -H "Authorization: Bearer $AGENTISEND_API_KEY"
200 with an empty body
Response

The message log, and one message

GET /emails/export.csv — the summary is "The message log as CSV — yours, take it with you." Its filters are the ones on GET /emails: status, q, from, to, domain, bounce_class, api_key_id, template_id, since and until. A monthly export is since and until on the month; the bounces of one domain are domain and status=bounced.

For a single message:

  • GET /emails/{id}/mime — the exact RFC 5322 source, headers and body as they were sent.
  • GET /emails/{id}/eml — the same message as a download.
  • GET /emails/{id}/attachments — what the email carried, each with filename, content_type, size_bytes and bytes_available, which says whether the payload is still retrievable.
  • GET /emails/{id}/attachments/{aid} — the bytes of one attachment, exactly as they were sent, served as an inert download.
  • GET /emails/{id}/events — every event recorded for the message, oldest first.

Logs and the audit trail

GET /audit-log is "Every change anyone made on this account (keys, kill switch, domains, approvals, team, settings), with what it looked like before." Each row has action, actor_type, actor_email, before, after and created_at. GET /logs is every API request the account made, with method, route, status, duration_ms and error_code, filterable by since, until, status_class, route, error_code and api_key_id. Both page with cursor.

Leaving

DELETE /account — the summary is "Close this account: revoke every key, pause every budget, suspend sending. Data stays readable and exportable until the retention window ends." The reply carries closed_at, data_removed_after, retention_days and keys_revoked. Take GET /account/export before you call it: the call revokes every key, and data_removed_after is the date the rows go.

Next