> ## Documentation Index
> Fetch the complete documentation index at: https://sendmux.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Read mailbox message content

> Read raw or cleaned mailbox message bodies with content controls.

The Sendmux Mailbox API is for mailbox-scoped access. Use it when a client should act as a mailbox, or as one mailbox from a connected-app mailbox set, without managing team-wide resources.

## Message body APIs

Use the raw body endpoint when you need the message body exactly as available from the mailbox.

```bash theme={null}
curl "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/body?part=both&max_body_chars=50000" \
  -H "Authorization: Bearer smx_mbx_your_key_here"
```

```json theme={null}
{
  "ok": true,
  "data": {
    "id": "msg_123",
    "thread_id": "thr_123",
    "part": "both",
    "body": {
      "text": "Original body text...",
      "html": "<p>Original body HTML...</p>",
      "is_truncated": false,
      "truncated_at_chars": null
    },
    "states": {
      "email_state": "state_token"
    }
  },
  "meta": {
    "request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
```

Use the clean content endpoint when you want deterministic body cleaning and structured metadata.

```bash theme={null}
curl "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/content?strip_signature=true&strip_quotes=true&include_links=true&include_html=false&include_headers=selected&include_attachments=metadata" \
  -H "Authorization: Bearer smx_mbx_your_key_here"
```

```json theme={null}
{
  "ok": true,
  "data": {
    "id": "msg_123",
    "thread_id": "thr_123",
    "subject": "Invoice question",
    "body": {
      "format": "text",
      "text": "Clean body text...",
      "html": null,
      "is_truncated": false,
      "truncated_at_chars": null,
      "signature_stripped": true,
      "quotes_stripped": true,
      "extracted_links": ["https://example.com/invoice"]
    },
    "attachments": [
      {
        "id": "att_123",
        "filename": "invoice.pdf",
        "content_type": "application/pdf",
        "size_bytes": 12345,
        "disposition": "attachment",
        "content_id": null,
        "download_url": "/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=..."
      }
    ]
  },
  "meta": {
    "request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
  }
}
```

Clean content controls:

| Parameter             | Values                     | Default                                           | Applies to                                        |
| --------------------- | -------------------------- | ------------------------------------------------- | ------------------------------------------------- |
| `part`                | `auto`, `text`, `html`     | `auto`                                            | Message content, thread content, batch clean JSON |
| `max_body_chars`      | `1` to `1000000`           | `100000` for messages, `25000` per thread message | Raw body, message content, thread content, batch  |
| `strip_signature`     | `true`, `false`            | `true`                                            | Message content, thread content, batch clean JSON |
| `strip_quotes`        | `true`, `false`            | `true`                                            | Message content, thread content, batch clean JSON |
| `include_links`       | `true`, `false`            | `true`                                            | Message content, thread content, batch clean JSON |
| `include_html`        | `true`, `false`            | `false`                                           | Message content, thread content, batch clean JSON |
| `include_headers`     | `none`, `selected`, `full` | `selected`                                        | Message content, thread content, batch clean JSON |
| `include_attachments` | `none`, `metadata`         | `metadata`                                        | Message content, thread content, batch clean JSON |
| `cursor`              | Opaque cursor              | none                                              | Thread content                                    |
| `limit`               | `1` to `100`               | `25`                                              | Thread content                                    |

<Note>
  Body endpoints do not parse attachment contents. Attachments are returned as
  metadata or downloaded separately. PDF, CSV, Office document, and OCR parsing
  are not part of these APIs.
</Note>

## Next steps

<Columns cols={2}>
  <Card title="Mailbox API introduction" icon="book-open" href="/docs/mailbox-api/introduction" />

  <Card title="Attachments" icon="paperclip" href="/docs/developer-tools/mailbox-api/attachments" />
</Columns>
