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
- 1Open Emails → Receiving
Go to Emails and select the "Receiving" tab.
- 2Open the message
Open the received email that includes the attachment.
- 3Download
Click the attachment to download it locally.
For automated processing, use the Attachments API instead.
Process attachments programmatically
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.
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
idstringoptionalThe attachment id, unique within the received email.
filenamestringoptionalThe attachment file name (e.g. invoice.pdf).
content_typestringoptionalMIME type of the attachment (e.g. image/png).
content_dispositionstringoptionalattachment or inline (inline parts are typically embedded images).
content_idstringoptionalThe MIME Content-ID for an inline part, used to reference it from the HTML body.
download_urlstringoptionalA short-lived URL to download the raw bytes. Valid for 1 hour.
expires_atstringoptionalISO 8601 timestamp when the current download_url expires.
Once you have processed the attachments, you may want to forward the email to another address.