---
title: "List a received message's attachments"
method: GET
path: "/v1/messages/received/{id}/attachments"
tags: ["Inbound"]
---

# List a received message's attachments

`GET /v1/messages/received/{id}/attachments`

## Request

- Base URL: `https://api.mails.ai`
- URL: `https://api.mails.ai/v1/messages/received/{id}/attachments`
- Auth: HTTP bearer

**Requires scope:** `read`. Every file in the message, embedded images included (`inline: true`). Files that could not be kept are listed under `omitted`.

## Path parameters

- `id` string, required

## Response `200`

The message's attachments.

- object
  - `data` ReceivedAttachment[], required: The message's files that were kept, embedded images included (`inline: true`), at most 100. Empty when it carried none or none could be kept.
    - `id` string, required: Attachment id (`att_…`), unique within the message.
    - `filename` string, required: The file's name, cleaned: no path, no control characters, at most 255 characters.
    - `content_type` string, required: The MIME type the sender declared, e.g. `application/pdf`.
    - `size` integer, required: Size in bytes of the decoded file.
    - `content_id` string, nullable, required: The part's Content-ID without angle brackets, which the HTML body references as `cid:`.
    - `inline` boolean, required: True for an image embedded in the HTML body rather than attached as a file.
  - `omitted` OmittedAttachment[]: Present only when the message carried files that could not be kept.
    - `filename` string, required: The file's name, cleaned like a kept attachment's: no path, no control characters, at most 255 characters. A file the email did not name reads `attachment.<ext>`.
    - `content_type` string, required: The MIME type the sender declared, in lower case; `application/octet-stream` when it was missing or malformed.
    - `size` integer, nullable, required: Size in bytes when known.
    - `reason` 'too_large' | 'budget' | 'over_quota' | 'unavailable' | 'too_many', required: Why the file was not kept: the reasons of `raw_omitted`, or `too_many` for files past the first 100 of one message.
  - `omitted_count` integer: How many files could not be kept: those in `omitted`, plus any past the 100 it lists. Present only when above 0.
  - `raw_omitted` 'too_large' | 'budget' | 'over_quota' | 'unavailable': Present when the raw email was not kept, and why, with the same values as `raw_omitted` on the received message. Without the raw email none of the message's files can be downloaded.

## Other responses

- `400`: Invalid request — malformed JSON or a field failed validation. Also `feature_not_enabled` when this server has a feature switched off (custom domains before they are available).
- `401`: Missing or invalid API key.
- `403`: The API key lacks the required scope (`insufficient_scope`), or the token belongs to an app connected by sign-in and this operation is closed to connected apps (`connected_app_not_allowed`).
- `404`: Resource not found in this workspace, or the agent a send names is archived (`agent_archived`).
- `500`: Internal server error.

---

[API](https://skmtc.dev/mails/apis/mails-ai-api.md) · [All operations](https://skmtc.dev/mails/apis/mails-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mails/apis/mails-ai-api/revisions/4d4930a8c33b?raw)
