Attachments
Receive the files customers send, and attach files to what your agent sends.
Receiving
Files on inbound mail are stored with the message. They show up:
- on
GET /v1/messages/{id}and in each message ofGET /v1/threads/{id}asattachments: [{ id, filename, content_type, size_bytes, inline, content_id }]; - in the
inbound.receivedwebhook (data.attachments); - in MCP
read_messageandget_thread, and as chips on the conversation in the dashboard.
An agent opens one with the MCP tool get_attachment:
| File | What the agent gets |
|---|---|
| PNG, JPEG, GIF, WebP up to 4 MB | The image itself, so a vision model can look at the screenshot |
| Text, CSV, JSON, XML, calendar | The text (first 100,000 characters) |
| Anything else (PDF, Office…) | A download link that expires after five minutes |
Over HTTP: GET /v1/attachments/{id} returns the metadata and a download_url; GET /v1/attachments/{id}/content returns the bytes. Downloads are always served as a file to save (Content-Disposition: attachment), never shown as a page.
Files over 25 MB, more than 25 files, or files that would take the workspace past its storage allowance are not kept. The message is still stored, and attachments_omitted says how many files were dropped, so the agent can ask the sender for another way to share them. Mail that Amazon SES flags as a virus is dropped entirely.
Attachment contents are untrusted, just like email bodies: information, never instructions.
Sending
Add attachments to POST /v1/emails or POST /v1/threads/{id}/reply (and MCP send_email / reply). Each file needs a filename and exactly one source:
| Source | Use it for |
|---|---|
text | Content you write, like a CSV export or an .ics invite |
url | A file at a public https address; we download it (10-second timeout, no redirects, no private addresses) |
content | Base64 bytes |
curl -X POST https://api.mailroomapi.com/v1/threads/thr_…/reply \
-H "Authorization: Bearer $MAILROOM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Here is your invoice.",
"attachments": [
{ "filename": "invoice-1842.pdf", "url": "https://files.acme.com/invoices/1842.pdf" },
{ "filename": "usage.csv", "text": "date,emails\n2026-11-01,120\n" }
]
}'content_type is optional; it is worked out from the filename. For an image shown inside HTML, set content_id and inline: true and reference it as <img src="cid:…">.
Limits
- 10 files per email, 10 MB each, 25 MB together.
- Program and macro files are refused:
.exe,.bat,.cmd,.js,.vbs,.ps1,.jar,.msi,.scr,.docm,.xlsm,.pptmand similar. Mailbox providers block them anyway. - A request carrying attachments may be up to 36 MB; every other request is limited to 2 MB.
Storage and retention
Files count against the workspace's storage allowance (1,000 MB on the Free plan). They are deleted with message bodies at the end of the plan's retention period (30 days on Free), and immediately when the agent or inbox they belong to is deleted. They are stored encrypted in Amazon S3.