---
title: "Read an attachment (iCloud Mail)"
method: POST
path: "/v1/icloud_mail/read_attachment"
tags: ["read"]
---

# Read an attachment (iCloud Mail)

`POST /v1/icloud_mail/read_attachment`

## Request

- Base URL: `https://muse.space`
- URL: `https://muse.space/v1/icloud_mail/read_attachment`
- Auth: HTTP bearer

Read one attachment of a message: the text of a PDF, Office or text file, or a picture as an image, with one-time codes and reset links removed.

## Request body

- MailReadAttachmentInput
  - `id` string, required: Message `id` from search, read or an event.
  - `part` string, required: `part` of an attachment, as mail.read lists them.
  - `max_chars` integer: Most characters of text to return.
  - `cursor` string: `next_cursor` of the previous part, to continue.

## Response `200`

The result.

- MailReadAttachmentOutput
  - `id` string, required
  - `part` string, required
  - `filename` string, required
  - `mime_type` string, required
  - `size_bytes` integer, required
  - `kind` 'text' | 'image', required
  - `text` string, required
  - `truncated` boolean, required
  - `next_cursor` string, nullable, required
  - `pages` integer
  - `image` object
    - `mime_type` 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp', required
    - `data_base64` string, required
  - `filtered` object, required
    - `one_time_codes` integer, required
    - `reset_links` integer, required

## Other responses

- `401`: `unauthorized`, `token_revoked`, `token_expired`
- `403`: `forbidden`, `recipient_not_allowed`
- `404`: `not_found`
- `409`: `reconnect_required`, `changed_since_read`
- `413`: `too_large`
- `422`: `invalid_arguments`, `unreadable`
- `429`: `rate_limited`, `send_cap_reached`, `send_cooldown`
- `500`: `internal`
- `502`: `upstream_unavailable`, `upstream_rejected`, `delivery_unconfirmed`

---

[API](https://skmtc.dev/muse/apis/muse-space-tool-catalogue.md) · [All operations](https://skmtc.dev/muse/apis/muse-space-tool-catalogue/llms.txt) · [OpenAPI document](https://skmtc.dev/muse/apis/muse-space-tool-catalogue/revisions/8bef59003b3c?raw)
