Skip to content

List inbound attachments ​

The attachments of one received message, each with a signed link to download it.

http
GET /v1/inbound-emails/{inbound_email_id}/attachments

Requires a Full access API key. Cursor-paginated.

Example ​

bash
curl "https://api.sendgrail.com/v1/inbound-emails/$INBOUND_EMAIL_ID/attachments" \
  -H "Authorization: Bearer $SENDGRAIL_API_KEY"

Response ​

json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "object": "attachment",
      "id": "8e0fd050-661f-4b3c-8178-c4f291d1f751",
      "filename": "invoice.pdf",
      "content_type": "application/pdf",
      "size": 20418,
      "content_id": null,
      "withheld": false,
      "download_url": "https://api.sendgrail.com/v1/inbound-emails/…/download?expires=…&signature=…",
      "expires_at": "2026-09-16T08:56:12+00:00"
    }
  ]
}

download_url needs no API key and expires after 15 minutes — fetch a fresh one when you need it. An attachment of a message that failed the virus scan has withheld: true and no link: the file was never kept.

content_id is set for an image embedded in the HTML (cid: references).

Transactional email on your own domain.