Documentation
Sign inGet started

Update a message in a thread

PATCH
/v1/email/threads/{thread_id}/messages/{message_id}
curl -X PATCH "https://us1.platform.bird.com/v1/email/threads/{thread_id}/messages/{message_id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "labels": {
      "add": [
        "urgent"
      ],
      "remove": [
        "pending"
      ]
    },
    "contact_id": "con_01krdgeqcxet5s7t44vh8rt9mg"
  }'
Applies read-state, label, and contact changes to a message in a conversation. Omitted fields are left unchanged. The read flag is only valid on received messages.
Cuerpo de la solicitud
labels
object
Label changes to apply. Labels in add are applied and labels in remove are taken off; other labels are left untouched. Adding a label that is already present, or removing one that is not, has no effect. System labels express state changes: on a conversation, adding spam files it as spam, adding archive files it away without deleting it, adding inbox (or removing spam, blocked, or archive) returns it to the inbox, and removing unread marks all retained received messages as read in one call; on a message, adding or removing unread flips read state, and adding or removing trash moves it to or out of the trash. Changes that contradict this model are rejected: adding more than one placement label in one request, adding blocked (blocking a sender is a receive-rule decision), removing inbox without adding a destination, adding trash or unread to a conversation (removing unread is the mark-all-read shortcut; trash uses the DELETE verb), placement labels on a message (move its conversation instead), and unread on a sent message. Custom labels are 1-64 characters with no commas, control characters, or leading or trailing whitespace. System label names and a small reserved set (all, archived, deleted, draft, drafts, flagged, important, junk, muted, none, outbox, pinned, read, scheduled, snoozed, starred) cannot be used as custom labels, in any casing. A conversation or message has at most 20 labels, system labels included.
Mostrar parámetros secundarios
labels.add
array of string
Labels to apply.
labels.remove
array of string
Labels to take off.
contact_id
nullable string
Contact to link this message to, or null to unlink the current contact.
Carga de respuesta
id
string
obligatorio
Message ID. Received messages have a rem_ ID, sent messages an em_ ID: the same IDs used by the received-message and sent-message logs.
direction
string
obligatorio
Which way the message went. inbound means you received it, outbound means you sent it.
Possible values: inbound, outbound
channel
string
obligatorio
Channel this message lives on. Always email.
thread_id
string
obligatorio
Conversation this message belongs to.
from
string
obligatorio
Sender address.
to
array of string
obligatorio
Recipient addresses on the To line.
cc
array of string
obligatorio
Recipient addresses on the Cc line. Empty when the message had none.
delivered_to
nullable string
obligatorio
Address the message was actually delivered to, when it differs from the mailbox address (for example mail routed in from another address). Null for sent messages and for mail addressed directly to the mailbox.
subject
nullable string
obligatorio
Message subject. Null when the message had no subject.
preview
nullable string
obligatorio
Short plain-text preview of the message body.
extracted_text
nullable string
Plain-text content of the message with quoted history stripped. Readable for the mailbox's full retention tier, in both directions. Always present when fetching a single message. On list endpoints it is included only when the request sets include=extracted_text. Null when no text could be extracted.
labels
array of string
obligatorio
Labels on this message. A received message always has exactly one placement label:
  • inbox: Accepted mail.
  • archive: The message's conversation was filed away.
  • spam: The message failed sender authentication.
  • blocked: The message was rejected by the mailbox's receive policy or rules.
A received message also has unread until it is read. trash marks a message in the trash, in either direction. Custom labels share the same list, and a message has at most 20 labels in total.
status
nullable string
obligatorio
Folded delivery status of a sent message:
  • accepted: Accepted for sending.
  • sent: Handed off to the provider.
  • delivered: All attempted recipients delivered.
  • failed: Terminal failure.
Null for received messages.
recipients
nullable array
obligatorio
Terminal per-recipient delivery outcomes of a sent message, filled in as each one becomes known and kept for the mailbox's full retention tier. Null for received messages and before any recipient reaches a terminal state. Per-recipient event detail lives on the sent-message log (source) for 30 days.
authentication
nullable string
obligatorio
Whether the sender of a received message was authenticated. pass means the sender's identity was verified. fail means it was checked and did not verify. unknown means no verdict could be determined, and the sender should not be treated as verified. Null for sent messages. This field is readable for the mailbox's full retention tier, so the verdict is still available after the 30-day received-message log has expired.
Possible values: pass, fail, unknown, null
spf_pass
nullable boolean
obligatorio
Whether SPF passed for the sender of a received message. Null for sent messages and when no verdict is available. This field is kept for the mailbox's retention tier.
dkim_pass
nullable boolean
obligatorio
Whether DKIM passed for the sender of a received message. Null for sent messages and when no verdict is available. This field is kept for the mailbox's retention tier.
dmarc_pass
nullable boolean
obligatorio
Whether DMARC passed for the sender of a received message. Null for sent messages and when no verdict is available. This field is kept for the mailbox's retention tier.
purge_at
string
obligatorio
When the message will be permanently deleted: the end of the mailbox's retention tier, pulled nearer (at most 30 days out) while the message is in the trash. Restore a trashed message before then with PATCH {"labels": {"remove": ["trash"]}}.
attachment_count
integer
obligatorio
Number of attachments on the message.
attachment_manifest
array of object
obligatorio
Attachment metadata (filename, content type, size). Stays readable for the mailbox's retention tier even after the attachment bytes themselves have expired.
Mostrar atributos secundarios
attachment_manifest.id
string
obligatorio
Attachment ID, used to download the attachment bytes.
attachment_manifest.filename
nullable string
obligatorio
Original filename, or null when the attachment had none.
attachment_manifest.content_type
nullable string
obligatorio
MIME content type, or null when it could not be determined.
attachment_manifest.size
integer
obligatorio
Attachment size in bytes.
reference_ids
array of string
obligatorio
RFC 5322 References header entries used to thread the conversation.
contact_id
nullable string
obligatorio
Contact linked to this message, or null when none is linked.
source
object
obligatorio
Link to the message's entry in the received-message or sent-message log, which has delivery analytics such as per-recipient events. Log entries expire 30 days after the message occurred.
Mostrar atributos secundarios
source.resource
string
obligatorio
API path of the log entry for this message.
source.available_until
string
obligatorio
When the log entry (and the message's original rendered source) expires.
occurred_at
string
obligatorio
When the message was received or accepted for sending.