List Received Attachments
GET /emails/receiving/:id/attachments — list the attachments on a received email.
/emails/receiving/:id/attachmentsList the attachments on a received email. Each entry carries its filename, size, and MIME metadata, plus a download_url for the file bytes when they were stored (downloadable: true). The URL is not a public link — fetch it with your API key like any other endpoint.
limit parameter is optional — if you omit it, up to 1,000 attachments are returned in a single response, with has_more set to true in the unlikely event more exist. See Pagination.Path parameters
idstringrequiredThe id of the received email.
Query parameters
limitnumberoptionalNumber of attachments to retrieve per page. Optional. Maximum 100, minimum 1.
afterstringoptionalThe attachment id after which more attachments are retrieved. The passed id is not included. Cannot be combined with before.
beforestringoptionalThe attachment id before which more attachments are retrieved. The passed id is not included. Cannot be combined with after.
Request
import { Mailblastr } from 'mailblastr';
const mb = new Mailblastr('mb_xxxxxxxxx');
const { data, error } = await mb.emails.receiving.listAttachments('4ef9a417-02e9-4d39-ad75-9611e0fcc33c');
console.log({ data, error });Response
{
"object": "list",
"has_more": false,
"data": [
{
"id": "2a0c9ce0-3112-4728-976e-47ddcd16a318",
"filename": "avatar.png",
"size": 4096,
"content_type": "image/png",
"content_disposition": "inline",
"content_id": "img001",
"downloadable": true,
"download_url": "https://www.mailblastr.com/api/emails/receiving/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/attachments/2a0c9ce0-3112-4728-976e-47ddcd16a318"
}
]
}Errors
Returns not_found (404) if no received email with that id exists for your account; validation_error for a bad cursor or out-of-range limit. See the error reference.