Sign inGet Started

Get a thread

GET
/v1/email/threads/{thread_id}
const thread = await bird.email.threads.get("thr_01abc");
console.log(thread.subject);
Odpowiedź200
{
  "id": "thr_01krdgeqcxet5s7t44vh8rt9mg",
  "mailbox_id": "mbx_01krdgeqcxet5s7t44vh8rt9mg",
  "channel": "email",
  "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg",
  "subject": "Re: Your order",
  "participant_names": [
    {
      "address": "ada@example.com",
      "name": "Ada Lovelace"
    }
  ],
  "last_direction": "inbound",
  "folder": "inbox",
  "labels": [
    "urgent"
  ],
  "highlights": {
    "subject": [
      "Re: your **order** **4821**"
    ],
    "text": [
      "confirming your **order** **4821** shipped"
    ]
  }
}

Returns a single conversation. Fetch the messages in the conversation with List messages in a thread. A thread whose retention tier has ended returns 410 Gone.

Parametry

thread_idstring

Thread identifier. Starts with thr_.

Treść odpowiedzi

id
string
wymagane

Thread ID.

mailbox_id
string
wymagane

Mailbox this conversation belongs to.

channel
string
wymagane

Channel this conversation lives on. Always email.

contact_id
nullable string
wymagane

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

subject
nullable string
wymagane

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

participants
array of string
wymagane

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

participant_names
array of object
wymagane

Display names for participants, taken from this conversation's messages. A name is either the one a sender gave in their From header or the one your mailbox gave a To or Cc recipient when sending. When a participant was named more than once, the most recent name is shown. Names are not verified, so identify participants by address. A participant without a name is absent.

Pokaż atrybuty podrzędne
participant_names.address
string
wymagane

Participant address, as listed in the conversation's participants.

participant_names.name
string
wymagane

Display name for this participant, such as Ada Lovelace. It is not verified.

message_count
integer
wymagane

Number of retained messages in this conversation, both directions.

unread_count
integer
wymagane

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

last_message_at
string
wymagane

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

last_direction
string
wymagane

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

Possible values: inbound, outbound

folder
string
wymagane

Primary conversation folder. The supported folders are inbox, archive, spam, blocked, sent, and trash. Blocked and sent are assigned automatically. The sent filter also includes sent conversations that received replies and still sit in the inbox; moving them with PATCH removes them from the sent filter.

Possible values: inbox, archive, spam, blocked, sent, trash

read
boolean
wymagane

Whether every retained received message is read, including trash, spam and blocked messages. Outbound messages do not affect this state.

labels
array of string
wymagane

Custom labels applied to this conversation. Folder and read state are separate fields.

created_at
string
wymagane

When the thread was created.

updated_at
string
wymagane

When the thread last changed.

highlights
object

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

Pokaż atrybuty podrzędne
scheduled_count
integer

Scheduled or dispatching sends targeting this conversation. Returned by conversation get and list, including zero when none remain. Omitted by search.

next_scheduled_at
string

Earliest due time among scheduled or dispatching sends. Returned by conversation get and list only when scheduled_count is positive. Omitted by search and when no sends remain.

Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.