---
title: "Get a message attachment"
canonical: "https://bird.com/docs/api/reference/get-amb-message-attachment"
---

# Get a message attachment

`GET /v1/amb/messages/{message_id}/attachments/{index}`

Downloads the attachment at the zero-based `index` in a message's
`content.attachments` array and returns its decrypted bytes as
`application/octet-stream`; the `Content-Disposition` header carries the
original filename, and the message's attachment metadata retains the
media type. Works for attachments a customer sent and for attachments
you sent. For a received attachment, `message_id` is the `message.id`
of the `amb.received` webhook event, and `index` is the attachment's
position in that message's `content.attachments` array.

Apple retains an attachment for 30 days, renewed each time its reference
is reused; availability after that period is not guaranteed, so download
an attachment when the message arrives rather than on demand later. An unknown message or
index returns `404`; an unavailable or expired Apple reference returns
`503`.

## Code samples

**CLI**

```sh
bird amb attachment <message-id> <index>
```

Examples: [CLI](/docs/api/reference/get-amb-message-attachment.cli.md) · [cURL](/docs/api/reference/get-amb-message-attachment.curl.md)

## Path parameters

- `message_id` (string): Message identifier. Starts with `amb_`. For a received attachment, use the `message.id` from the `amb.received` webhook event.
- `index` (integer): Zero-based position in the message's `content.attachments` array.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
