List Email Attachments

Retrieve a list of attachments from a sent email, each with a time-limited download URL.

GET/emails/{email_id}/attachments

Requires an API key with the emails:read permission.

Path Parameters

email_idstringrequired

The sent email ID (UUID).

Query Parameters

limitnumber

Maximum number of results to return. Min 1, max 100. Default 20.

afterstring

Cursor for forward pagination.

beforestring

Cursor for backward pagination.

Response Fields

objectstring

Always "list".

has_moreboolean

Whether there are more results available.

dataarray

Array of attachment objects. Each item contains object, id, filename, size, content_type, content_disposition, content_id, download_url, and expires_at.

curl -X GET 'https://api.postflare.dev/emails/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794/attachments' \
  -H 'Authorization: Bearer sk_xxxxxxxxx'
const response = await fetch(
  'https://api.postflare.dev/emails/49a3999c-0ce1-4ea6-ab68-afcd6dc2e794/attachments',
  {
    headers: {
      'Authorization': 'Bearer sk_xxxxxxxxx',
    },
  }
);

const data = await response.json();

Response

Response
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "attachment",
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "filename": "invoice.pdf",
      "size": 102400,
      "content_type": "application/pdf",
      "content_disposition": "attachment",
      "content_id": null,
      "download_url": "https://storage.example.com/attachments/invoice.pdf?signature=...",
      "expires_at": "2026-01-01T01:00:00.000Z"
    }
  ]
}