<Intro>

<EndpointHeader />

<Description>

Returns a single conversation. Fetch the messages in the conversation with `GET /v1/email/threads/{thread_id}/messages`. A thread whose retention period has ended returns `410 Gone`.

</Description>

</Intro>

<Payload kind="response">

<Field name="id" type="string" required>

<Description>

Thread ID.

</Description>

</Field>

<Field name="mailbox_id" type="string" required>

<Description>

Mailbox this conversation belongs to.

</Description>

</Field>

<Field name="channel" type="string" required>

<Description>

Channel this conversation lives on. Always `email`.

</Description>

</Field>

<Field name="contact_id" type="nullable string" required>

<Description>

Contact linked to this conversation, or null when none is linked.

</Description>

</Field>

<Field name="subject" type="nullable string" required>

<Description>

Subject of the conversation, taken from its first message. Null when that message had no subject.

</Description>

</Field>

<Field name="participants" type="array of string" required>

<Description>

Addresses that appear on the retained messages in this conversation, including the mailbox's own address.

</Description>

</Field>

<Field name="message_count" type="integer" required>

<Description>

Number of retained messages in this conversation, both directions.

</Description>

</Field>

<Field name="unread_count" type="integer" required>

<Description>

Number of retained received messages that are still unread. Spam and blocked mail is not counted.

</Description>

</Field>

<Field name="last_message_at" type="string" required>

<Description>

When the most recent retained message in this conversation was received or sent.

</Description>

</Field>

<Field name="last_direction" type="string" required>

<Description>

Direction of the most recent message — `inbound` for a received message, `outbound` for a sent one.

</Description>

<Description>

Possible values: `inbound`, `outbound`

</Description>

</Field>

<Field name="labels" type="array of string" required>

<Description>

Labels on this conversation. Exactly one system placement label is always present — `inbox`, `archive` (filed away, done for now), `spam` (the opening message failed sender authentication), or `blocked` (rejected by the mailbox's receive policy or rules) — set by the message that started the conversation. Move a conversation by updating its labels: add `spam` to file it as spam, add `archive` to clean it out of the inbox, and add `inbox` — or remove `spam`, `blocked`, or `archive` — to bring it back. An archived conversation returns to the inbox by itself when a new message arrives. Custom labels share the same list; a conversation carries at most 20.

</Description>

</Field>

<Field name="created_at" type="string" required>

<Description>

When the thread was created.

</Description>

</Field>

<Field name="updated_at" type="string" required>

<Description>

When the thread last changed.

</Description>

</Field>

<Field name="highlights" type="object">

<Description>

Matched search fragments, keyed by the field that matched. Returned only by thread search; omitted when listing threads.

</Description>

<FieldChildren kind="response">

<Field name="subject" type="array of string" prefix="highlights.">

<Description>

Matched fragments from the conversation's subject.

</Description>

</Field>

<Field name="text" type="array of string" prefix="highlights.">

<Description>

Matched fragments from a message's body text.

</Description>

</Field>

</FieldChildren>

</Field>

</Payload>