# Get attachment

> Returns one attachment with its content base64-encoded.

Source: https://mailvina.com/docs/api-reference/receiving/get-attachment · Base URL: https://api.mailvina.com · Guide: https://mailvina.com/docs/receiving

`GET /emails/receiving/:id/attachments/:attachment_id`

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The received email ID. |
| `attachment_id` | `string` | yes | e.g. `att_1`. |

**Request**

```bash
curl -X GET 'https://api.mailvina.com/emails/receiving/:id/attachments/:attachment_id' \
  -H 'Authorization: Bearer mv_xxxxxxxxx'
```

```js
const res = await fetch('https://api.mailvina.com/emails/receiving/:id/attachments/:attachment_id', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.MAILVINA_API_KEY}`,
  },
});
const data = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.mailvina.com/emails/receiving/:id/attachments/:attachment_id",
    headers={"Authorization": f"Bearer {os.environ['MAILVINA_API_KEY']}"},
)
print(res.json())
```

**Response**

```json
{
  "object": "attachment",
  "id": "att_1",
  "filename": "receipt.pdf",
  "content_type": "application/pdf",
  "size": 48213,
  "content": "JVBERi0xLjcK…"
}
```

### The attachment object

A file attached to a received email.

**Fields**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | `string` | no | Always `attachment`. |
| `id` | `string` | no | Attachment ID, e.g. `att_1`. |
| `filename` | `string` | no | File name. |
| `content_type` | `string` | no | MIME type. |
| `size` | `number` | no | Size in bytes. |
| `content` | `string` | no | The file, base64-encoded. |
