# Download an attachment

**`GET https://myagentmail.com/v1/inboxes/{id}/messages/{messageId}/attachments/{aid}`**

Group: Messages
Operation ID: `getAttachment`

Streams the raw attachment bytes with the original `Content-Type` and `Content-Disposition` headers.

## Path parameters

- `id` (string, required) — Inbox UUID
- `messageId` (string, required) — Message UUID
- `aid` (string, required) — Attachment UUID

## Responses

### 200 — Attachment bytes

```json
"string"
```

## Code samples

### TypeScript

```typescript
import { MyAgentMail } from "myagentmail";

const client = new MyAgentMail({ apiKey: process.env.MYAGENTMAIL_API_KEY! });

// GET /v1/inboxes/{id}/messages/{messageId}/attachments/{aid}
const result = await client.request("get", "/v1/inboxes/{id}/messages/{messageId}/attachments/{aid}", { params: { id: "00000000-0000-0000-0000-000000000000", messageId: "00000000-0000-0000-0000-000000000000", aid: "00000000-0000-0000-0000-000000000000" } });
```

### curl

```bash
curl -X GET 'https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000' \
  -H 'X-API-Key: $MYAGENTMAIL_API_KEY'
```

### Python

```python
import os, requests

r = requests.get(
    "https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/messages/00000000-0000-0000-0000-000000000000/attachments/00000000-0000-0000-0000-000000000000",
    headers={"X-API-Key": os.environ["MYAGENTMAIL_API_KEY"]},
)
r.raise_for_status()
print(r.json())
```
