Attachments

Sending#

Each attachment is an object with either content (base64) or url, never both.

{
  "to": "you@example.com",
  "subject": "Report",
  "text": "Attached.",
  "attachments": [{ "filename": "report.pdf", "content_type": "application/pdf", "content": "JVBERi0xLjQK..." }]
}

Optional fields: content_disposition (inline or attachment) and content_id for inline images. Up to 50 attachments per message; inline content over 6 MB in total returns 413 payload_too_large, so use url for large files. A url must be a public https address; the server fetches it with no redirects, a 10 second timeout and limits of 10 MB per file and 25 MB in total. The request body limit is 40 MB.

Receiving and downloading#

Messages list their attachments with attachment_id, filename, content_type, size, inline. GET .../messages/:message_id/attachments/:attachment_id returns metadata and a download_url valid for an hour. The download is served with Content-Disposition: attachment, X-Content-Type-Options: nosniff and Content-Security-Policy: sandbox, so a browser will not render it in your origin.

Downloading all attachments of a thread in one call is not supported. The dashboard lists attachment names on a message but cannot send or download them; the TypeScript SDK can send them but has no download method.