Receiving

Process receiving attachments

List a received email’s attachments and download each one from its download_url.

A common reason to receive email is to process attachments — airplane tickets, receipts, expenses, and so on. You can inspect attachments in the dashboard, or process them programmatically with the Attachments API.

View and download in the dashboard

  1. 1
    Open Emails → Receiving

    Go to Emails and select the "Receiving" tab.

  2. 2
    Open the message

    Open the received email that includes the attachment.

  3. 3
    Download

    Click the attachment to download it locally.

For automated processing, use the Attachments API instead.

Process attachments programmatically

Webhooks include attachment metadata only — not the content. Call the List attachments API to get each attachment's download_url, which points at the actual bytes. This keeps webhook payloads small for serverless platforms with limited request-body sizes.

After the email.received webhook, call the Attachments API for the email_id. It returns a data array of attachments, each with metadata and a download_url you fetch to get the bytes. To retrieve a single attachment, use Retrieve attachment.

A download_url is not a public link: fetch it with the same Authorization: Bearer header as every other API call. It does not expire. Attachments whose bytes were not stored have downloadable: false and no download_url — skip those rather than retrying them.
import { Mailblastr } from 'mailblastr';

const mb = new Mailblastr('mb_xxxxxxxxx');

const { data, error } = await mb.emails.receiving.listAttachments('56761188-7520-42d8-8898-ff6fc54ce618');
console.log({ data, error });

Attachment fields

idstringoptional

The attachment id, unique within the received email.

filenamestringoptional

The attachment file name (e.g. invoice.pdf).

content_typestringoptional

MIME type of the attachment (e.g. image/png).

content_dispositionstringoptional

attachment or inline (inline parts are typically embedded images).

content_idstringoptional

The MIME Content-ID for an inline part, used to reference it from the HTML body.

downloadablebooleanoptional

Whether the file bytes were stored and can be downloaded. false means no download_url is returned.

download_urlstringoptional

URL to download the raw bytes. Requires your API key — send the same Authorization: Bearer header. Omitted when downloadable is false.

Once you have processed the attachments, you may want to forward the email to another address.