Receiving

Process receiving attachments

List a received email’s attachments and download each one with a short-lived 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 valid for 1 hour. After it expires, call the Attachments API again to get a fresh URL. Each attachment also carries an expires_at field telling you exactly when its current URL stops working.
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.

download_urlstringoptional

A short-lived URL to download the raw bytes. Valid for 1 hour.

expires_atstringoptional

ISO 8601 timestamp when the current download_url expires.

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