# Emails & threads

> How Inboundr parses, stores, and groups messages into conversations.

Every message Inboundr receives is stored as an **email** and grouped into a
**thread**. This is what lets an agent read a whole conversation in context
instead of one message at a time.

## The email object

Inbound mail is parsed into clean JSON: sender and recipients, subject, text and
HTML bodies, attachment metadata, authentication verdicts, and threading
headers. Object keys are prefixed by type — emails are `em_…`, threads are
`thr_…`.

```json
{
  "id": "em_abc123",
  "direction": "inbound",
  "threadId": "thr_xyz789",
  "messageId": "<CAEabc...@mail.gmail.com>",
  "fromAddress": "customer@example.com",
  "toAddresses": ["support@yourdomain.com"],
  "ccAddresses": [],
  "subject": "Can you help?",
  "textBody": "Hi there…",
  "htmlBody": "<p>Hi there…</p>",
  "attachments": [
    { "filename": "invoice.pdf", "contentType": "application/pdf", "size": 48210, "stored": true }
  ],
  "spamVerdict": "PASS",
  "spfVerdict": "PASS",
  "dkimVerdict": "PASS",
  "receivedAt": "2026-07-20T10:30:00.000Z"
}
```

<Note>
  List and thread responses return **summaries** (no `textBody`/`htmlBody`) for
  speed. Fetch a single email by id to get the full bodies and attachment
  metadata.
</Note>

## Authentication verdicts

Each inbound email carries the results of standard email authentication checks,
so you can decide how much to trust it:

| Verdict | Field | Meaning |
| --- | --- | --- |
| Spam | `spamVerdict` | Content-based spam assessment. |
| SPF | `spfVerdict` | Whether the sending server is authorized for the domain. |
| DKIM | `dkimVerdict` | Whether the message signature validates. |

`PASS` / `FAIL` are the meaningful outcomes.

## Threading

Inboundr groups messages into a `threadId` using the standard RFC 5322
`Message-ID`, `In-Reply-To`, and `References` headers, so a whole exchange comes
back as one conversation via `GET /v1/threads/{id}` or the `get_thread`
[MCP tool](/integrations/mcp) — no reassembly required on your end.

## Attachments

Attachment **metadata** (filename, content type, size) is always returned.
Attachments with `stored: true` can be downloaded via a short-lived presigned
URL — see the [attachments endpoint](/api-reference/attachments/download) or the
`get_attachment` [MCP tool](/integrations/mcp).

## Reading email

<CardGroup cols={2}>
  <Card title="Emails API" icon="envelope" href="/api-reference/emails/list">
    List with filters and pagination, or fetch one in full.
  </Card>
  <Card title="Threads API" icon="comments" href="/api-reference/threads/get">
    Fetch every message in a conversation, oldest first.
  </Card>
</CardGroup>
