---
title: "Get thread by ID"
method: GET
path: "/api/e2/mail/threads/{id}"
tags: ["Inbox"]
---

# Get thread by ID

`GET /api/e2/mail/threads/{id}`

Retrieve a complete email thread (conversation) with all messages.

**What You Get:**
- Thread metadata (subject, participants, timestamps)
- All messages in the thread (both inbound and outbound)
- Messages sorted chronologically by thread position

**Message Types:**
- `inbound` - Emails you received
- `outbound` - Emails you sent (includes delivery status)

## Path parameters

- `id` string, required — The unique thread ID to retrieve

## Response `200`

Response for status 200

- object
  - `thread` object, required
    - `id` string, required — Unique identifier for the thread
    - `root_message_id` string, required — RFC 2822 Message-ID of the first message in the thread
    - `normalized_subject` string, nullable — Normalized subject line (stripped of Re:, Fwd:, etc.)
    - `participant_emails` string[], required — Array of all unique email addresses that have participated in this thread
    - `participant_names` string[], required — Array of formatted participant names in the format 'First Last <email@domain.com>' or just 'email@domain.com' if no name is available
    - `message_count` number, required — Total number of messages in the thread
    - `last_message_at` string, required — ISO 8601 timestamp of the most recent message
    - `created_at` string, required — ISO 8601 timestamp when the thread was created
    - `updated_at` string, required — ISO 8601 timestamp when the thread was last updated
  - `messages` object[], required — Array of all messages in the thread, sorted by thread position (chronological)
    - `id` string, required — Unique identifier for the message
    - `message_id` string, nullable — RFC 2822 Message-ID header value
    - `type` 'inbound' | 'outbound', required
    - `thread_position` number, required — Position of the message in the thread (0 = first message)
    - `subject` string, nullable — Subject line of the message
    - `text_body` string, nullable — Plain text body of the message
    - `html_body` string, nullable — HTML body of the message
    - `from` string, required — Formatted sender (display name and email)
    - `from_name` string, nullable — Sender display name if available
    - `from_address` string, nullable — Sender email address
    - `to` string[], required — Array of recipient email addresses
    - `cc` string[], required — Array of CC recipient email addresses
    - `bcc` string[], required — Array of BCC recipient email addresses
    - `date` string, nullable — ISO 8601 timestamp from the Date header
    - `received_at` string, nullable — ISO 8601 timestamp when the message was received (inbound only)
    - `sent_at` string, nullable — ISO 8601 timestamp when the message was sent (outbound only)
    - `is_read` boolean, required — Whether the message has been read (always true for outbound)
    - `read_at` string, nullable — ISO 8601 timestamp when the message was marked as read
    - `has_attachments` boolean, required — Whether the message has any attachments
    - `attachments` object[], required — Array of attachment metadata
      - `filename` string — Original filename of the attachment
      - `contentType` string — MIME type of the attachment
      - `size` number — Size of the attachment in bytes
      - `contentId` string, nullable — Content-ID for inline attachments
      - `content` string — Base64-encoded content (if included)
    - `in_reply_to` string, nullable — RFC 2822 In-Reply-To header value
    - `references` string[], required — Array of Message-IDs from the References header
    - `headers` unknown, required
    - `tags` object[], required — Array of tags attached to the message (outbound only)
      - `name` string, required — Tag name
      - `value` string, required — Tag value
    - `status` string — Delivery status for outbound messages (pending, sent, failed, bounced)
    - `failure_reason` string, nullable — Error message if the outbound message failed to send
  - `total_count` number, required — Total number of messages returned

## Other responses

- `400` — Response for status 400
- `401` — Response for status 401
- `404` — Response for status 404
- `500` — Response for status 500

---

[API](https://skmtc.dev/stainless-api/apis/inbound-email-api.md) · [All operations](https://skmtc.dev/stainless-api/apis/inbound-email-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stainless-api/inbound-email-api/revisions/e279d3cb940b/schema)
