Update a thread
/v1/email/threads/{thread_id}const thread = await bird.email.threads.update("thr_01abc", {
folder: "archive",
});
console.log(thread.id);thread = client.email.threads.update(
"thr_01krdgeqcxet5s7t44vh8rt9mg", folder="archive"
)
print(thread.id)thread, err := client.Email.Threads.Update(context.Background(), "thr_123", bird.EmailThreadsUpdateParams{
Labels: &bird.EmailThreadLabelsUpdate{Add: &[]string{"urgent"}},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(thread.Id)$bird->email->threads->update(
'thr_01krdgeqcxet5s7t44vh8rt9mg',
(new EmailThreadUpdateRequest())
->setLabels((new EmailThreadLabelsUpdate())->setAdd(['escalated']))
->setContactId('con_01krdgeqcxet5s7t44vh8rt9mg'),
);bird email threads update <thread-id> --body-file - <<'JSON'
{
"folder": "inbox",
"labels": {
"add": [
"urgent"
],
"remove": [
"pending"
]
},
"contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
}
JSONcurl -X PATCH "https://us1.platform.bird.com/v1/email/threads/{thread_id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"folder": "inbox",
"labels": {
"add": [
"urgent"
],
"remove": [
"pending"
]
},
"contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
}'{
"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"
]
}
}
Sets the conversation's read state and folder, adds or removes custom labels, and links or unlinks a contact. Set read to true or false to mark all retained received messages read or unread. Set folder to inbox, archive or spam; blocked and sent are assigned automatically. Use DELETE to trash a conversation and POST restore to recover eligible retained messages. A trashed conversation must be restored before its folder can change. Labels accept custom names only. An archived conversation returns to the inbox when a new received message is neither spam nor blocked. To block a sender going forward, add a receive rule. Any field you leave out stays unchanged.
参数
thread_idstringThread identifier. Starts with thr_.
请求载荷
readMark all retained received messages read or unread. Includes trash, spam and blocked messages; unread_count continues to exclude them.
folderMove a non-trashed conversation to inbox, archive or spam. Use DELETE to trash it and POST restore to recover it. Blocked and sent folders are assigned automatically.
Possible values: inbox, archive, spam
labelsCustom labels to add or remove. System and reserved names are refused; use read and folder for thread state. The resulting custom-label set must contain at most 20 labels; larger sets return 422.
contact_idContact to link this conversation to, or null to unlink the current contact.
响应载荷
idThread ID.
mailbox_idMailbox this conversation belongs to.
channelChannel this conversation lives on. Always email.
contact_idContact linked to this conversation, or null when none is linked.
subjectSubject of the conversation, taken from its first message. Null when that message had no subject.
participantsAddresses that appear on the retained messages in this conversation, including the mailbox's own address.
participant_namesDisplay 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.
显示子属性
participant_names.addressParticipant address, as listed in the conversation's participants.
participant_names.nameDisplay name for this participant, such as Ada Lovelace. It is not verified.
message_countNumber of retained messages in this conversation, both directions.
unread_countNumber of retained received messages that are still unread. Spam and blocked mail is not counted.
last_message_atWhen the most recent retained message in this conversation was received or sent.
last_directionDirection of the most recent message: inbound for a received message, outbound for a sent one.
Possible values: inbound, outbound
folderPrimary 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
readWhether every retained received message is read, including trash, spam and blocked messages. Outbound messages do not affect this state.
labelsCustom labels applied to this conversation. Folder and read state are separate fields.
created_atWhen the thread was created.
updated_atWhen the thread last changed.
highlightsMatched search fragments, keyed by the field that matched. Returned only by thread search. Omitted when listing threads.
scheduled_countScheduled or dispatching sends targeting this conversation. Returned by conversation get and list, including zero when none remain. Omitted by search.
next_scheduled_atEarliest 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.