Mail API reference

Mail API · Received

get/v1/workspaces/{workspace_id}/received/exportAuth

Stream the filtered received email as CSV. Same filters as GET /received. Rate-limited 1 concurrent + 5/hour per workspace.

Columns: id, received_at, mailbox, from, to (`; `-separated), subject, spam_verdict, spf, dkim, dmarc, size_bytes, attachments (count). No body content. A cell starting with `=`, `+`, `-` or `@` is prefixed with `'` so a spreadsheet does not run it as a formula. A rejected filter (400) does not count against the hourly cap, which is separate from the sent-email export's.

Path parameters

workspace_id*string · uuid

Id of the workspace.

Query parameters

qstring

Free-text search, case-insensitive. Matches a substring of the sender, the subject, the envelope recipient or a To address, or exactly a received email id (uuid) or its RFC 822 Message-ID (with or without the angle brackets).

mailbox_idstring · uuid

Only email received by this mailbox.

domain_idstring · uuid

Only email received by mailboxes on this domain (`domain.id`).

received_afterstring · date-time

Only email received at or after this instant. With `received_before`, the window may span at most 30 days.

received_beforestring · date-time

Only email received before this instant. Without `received_after`, the window is the 30 days before it.

spamboolean

`true`: only email the spam filter quarantined (verdict `junk` or `reject`). `false`: only email it did not. Omit for both.

unreadboolean

`true`: only unread email. `false`: only email already marked read. Omit for both.

Response · 200

text/csv stream: one header row, then one row per email. Content-Disposition: attachment.

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/received/export
Authorization: Bearer YOUR_TOKEN