Skip to main content
Returns a short-lived HTTPS download URL for the raw source of one message: the full RFC 5322 / MIME file exactly as stored, with every header (Received, Authentication-Results, DKIM and ARC signatures) and all attachments. Use it to debug delivery or authentication, investigate a suspicious message, turn a real message into a test fixture, or hand it to another tool as an .eml file. The tool result is the filename, size and a URL — never the message content; the agent saves the file out-of-band, e.g. with curl -o. To read a message, use get_email; for a single attachment, use download_attachment.

Parameters

string
required
The id of the message, as returned by search_emails or get_thread.

Example

Call
Result

How the URL works

  • The URL works exactly like the one download_attachment mints: an unguessable token bound server-side to the granting user’s session and this one message, no bearer needed, reusable for 24 hours.
  • GET on the URL streams the source as message/rfc822 with a Content-Disposition filename; there is no size cap.
  • The filename is the message’s subject (or its id when the subject is empty), with quotes, slashes and control characters replaced by _, capped at 200 bytes (UTF-8), plus .eml.
  • Only single messages: to save a whole conversation, call the tool once per message id from get_thread.

Errors

  • Email not found: <emailId>. Nothing was downloaded. Use search_emails or get_thread to find the message id. — no message with that id in the caller’s mailbox.