# List Attachments

`GET https://api.inboxjot.com/v1/emails/{email_id}/attachments`

Lists the attachments of one email, each with a download link that works for 10 minutes. Needs a Full key. A key limited to one domain sees only the emails of that domain, and answers 404 for the others.

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `email_id` | string | Yes | The email id, such as `eml_06d2mfk8r4tq9xv2bnc7s`. |

## Response

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object[] | No | The attachments, in the order they were sent. |
| `data[].id` | string | No | The attachment id. |
| `data[].filename` | string | No | The file name. |
| `data[].content_type` | string | No | The MIME type. |
| `data[].size` | integer | No | Size in bytes. |
| `data[].content_id` | string \| null | No | The content id of an inline image. |
| `data[].content_disposition` | string | No | `inline` when the file has a content id, otherwise `attachment`. |
| `data[].deleted_at` | string \| null | No | When data retention deleted the file. |
| `data[].download_url` | string \| null | No | A link to download the file. It works for 10 minutes. `null` after data retention deleted the file. |
| `data[].expires_at` | string \| null | No | When the download link stops working. |

## Request

cURL:

```bash
curl -X GET https://api.inboxjot.com/v1/emails/eml_06d2mfk8r4tq9xv2bnc7s/attachments \
  -H "Authorization: Bearer $INBOXJOT_API_KEY"
```

Node.js:

```javascript
import { Inboxjot } from 'inboxjot';

const inboxjot = new Inboxjot();

const { data } = await inboxjot.emails.listAttachments('eml_06d2mfk8r4tq9xv2bnc7s');
```

Rust:

```rust
use inboxjot::Inboxjot;

let client = Inboxjot::from_env()?;

let attachments = client.emails().list_attachments("eml_06d2mfk8r4tq9xv2bnc7s").await?;
```

Go:

```go
client := inboxjot.NewClient("")

attachments, err := client.Emails.ListAttachments(ctx, "eml_06d2mfk8r4tq9xv2bnc7s")
```

Python:

```python
from inboxjot import Inboxjot

inboxjot = Inboxjot()

attachments = inboxjot.emails.list_attachments("eml_06d2mfk8r4tq9xv2bnc7s")
```

## Responses

| Status | Description |
| --- | --- |
| 200 | Returns the attachments of the email. |
| 400 | A path parameter is invalid. |
| 401 | The API key is missing, revoked or expired. |
| 403 | The key is a Sending key, or the request comes from outside its IP allowlist. |
| 404 | The email does not exist in this workspace. |
| 429 | Too many requests for this key. Wait for the seconds in the Retry-After header. |
| 500 | Something failed on our side. Retry later. |

200:

```json
{
  "data": [
    {
      "id": "att_06d2mfk8r3hv8kc6pq1nd",
      "filename": "receipt-4821.pdf",
      "content_type": "application/pdf",
      "size": 48213,
      "content_id": null,
      "content_disposition": "attachment",
      "deleted_at": null,
      "download_url": "https://<account>.r2.cloudflarestorage.com/…",
      "expires_at": "2026-10-15T15:02:33.000Z"
    }
  ]
}
```

400:

```json
{
  "name": "validation_error",
  "status": 400,
  "message": "length is greater than 100",
  "errors": [
    {
      "message": "length is greater than 100",
      "location": "email_id"
    }
  ],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

401:

```json
{
  "name": "unauthorized",
  "status": 401,
  "message": "Unauthorized",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

403:

```json
{
  "name": "forbidden",
  "status": 403,
  "message": "This key cannot be used from 203.0.113.7",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

404:

```json
{
  "name": "not_found",
  "status": 404,
  "message": "Email not found",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

429:

```json
{
  "name": "rate_limit_exceeded",
  "status": 429,
  "message": "Too many attempts. Try again later.",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```

500:

```json
{
  "name": "unknown_error",
  "status": 500,
  "message": "Something went wrong. Please try again later.",
  "errors": [],
  "request_id": "5f0c6a2e-8d1b-4c7a-9e3f-2b6d4a1c8e90"
}
```
