API Reference

List Received Attachments

GET /emails/receiving/:id/attachments — list the attachments on a received email.

GET/emails/receiving/:id/attachments

List the attachments on a received email. Each entry includes a signed download_url for the file bytes, plus its filename, size, and MIME metadata.

This endpoint is paginated. The limit parameter is optional — if you omit it, all attachments are returned in a single response. See Pagination.

Path parameters

idstringrequired

The id of the received email.

Query parameters

limitnumberoptional

Number of attachments to retrieve per page. Optional. Maximum 100, minimum 1.

afterstringoptional

The attachment id after which more attachments are retrieved. The passed id is not included. Cannot be combined with before.

beforestringoptional

The 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",
      "download_url": "https://inbound-cdn.mailblastr.com/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/attachments/2a0c9ce0-3112-4728-976e-47ddcd16a318?signature=sig-123",
      "expires_at": "2026-06-24T14:29:41.521Z"
    }
  ]
}

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.