List a mailbox's messages
GET
/v1/email/mailboxes/{mailbox_id}/messages
curl -X GET "https://us1.platform.bird.com/v1/email/mailboxes/{mailbox_id}/messages" \
-H "Authorization: Bearer $TOKEN" \
--url-query "label=urgent" \
--url-query "limit=25"Returns the messages in a mailbox across all of its conversations, newest first. By default only received messages in the inbox and all sent messages are returned; pass disposition to see blocked or unauthenticated mail, or trashed=true to see trashed messages instead. Filter by direction, read state, label, or folded delivery status, or pass unread=true to answer "anything unread across all conversations?" in one call. Pass include=extracted_text to inline each message's extracted plain text. before and after filter by time; to page through results pass the response cursors back as starting_after or ending_before.
查询参数
disposition
string
Filter received messages by where they landed. When omitted, received messages in the inbox and all sent messages are returned.
direction
string
Filter to received (inbound) or sent (outbound) messages.
read
boolean
Filter received messages by read state.
label
string
Filter to messages carrying this label.
status
string
Filter sent messages by folded delivery status: accepted, sent, delivered, or failed.
trashed
boolean
When true, only trashed messages are returned (any direction or disposition).
unread
boolean
When true, only unread received messages are returned.
after
string
Filter to messages that occurred at or after this time. This is a time filter, not a cursor.
before
string
Filter to messages that occurred at or before this time. This is a time filter, not a cursor.
include
string
Set to extracted_text to inline each message's extracted plain text.
limit
integer
Maximum number of items to return per page.
starting_after
string
Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_before
string
Cursor from the prev_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order.
响应载荷
data
array of object
必填
显示子属性
data.id
string
必填
Message ID. Received messages carry a rem_ ID, sent messages an em_ ID — the same IDs used by the received-message and sent-message logs.
data.direction
string
必填
Direction of the message — inbound for a received message, outbound for a sent one.
data.channel
string
必填
Channel this message was carried on. Always email.
data.thread_id
string
必填
Conversation this message belongs to.
data.from
string
必填
Sender address.
data.to
array of string
必填
Recipient addresses on the To line.
data.cc
array of string
必填
Recipient addresses on the Cc line. Empty when the message had none.
data.delivered_to
nullable string
必填
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.
data.subject
nullable string
必填
Message subject. Null when the message had no subject.
data.preview
nullable string
必填
Short plain-text preview of the message body.
data.extracted_text
nullable string
Plain-text content of the message with quoted history stripped — readable for the mailbox's full retention period, 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.
data.read
nullable boolean
必填
Whether the message has been marked read. Null for sent messages.
data.disposition
nullable string
必填
Where the message landed: inbox for accepted mail, blocked (receive policy or rules), or unauthenticated (failed sender authentication). Null for sent messages. Trash state is carried separately in trashed_at.
data.status
nullable string
必填
Folded delivery status of a sent message: accepted, sent (provider handoff), delivered (all attempted recipients delivered), or failed (terminal failure). Null for received messages.
data.recipients
nullable array
必填
Terminal per-recipient delivery outcomes of a sent message, folded in as they become known — part of the message's durable memory. 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.
data.spf_pass
nullable boolean
必填
Whether SPF passed for the sender of a received message. Null for sent messages and when no verdict was computable. Part of the message's durable memory — readable for the mailbox's full retention period, so the verdict survives after the 30-day inbound log has expired.
data.dkim_pass
nullable boolean
必填
Whether DKIM passed for the sender of a received message. Null for sent messages and when no verdict was computable. Durable for the mailbox's retention period.
data.dmarc_pass
nullable boolean
必填
Whether DMARC passed for the sender of a received message. Null for sent messages and when no verdict was computable. Durable for the mailbox's retention period.
data.trashed_at
nullable string
必填
When the message was moved to the trash, or null when it is not trashed. Trashed messages are purged 30 days after trashing; restore it with PATCH {"trashed": false} before then.
data.rank
number
Relevance rank of this result. Present only on search results, higher is more relevant.
data.attachment_count
integer
必填
Number of attachments on the message.
data.attachment_manifest
array of object
必填
Attachment metadata (filename, content type, size). Remains readable for the mailbox's retention period even after the attachment bytes themselves have expired.
显示子属性
data.attachment_manifest.id
string
必填
Attachment ID, used to download the attachment bytes.
data.attachment_manifest.filename
nullable string
必填
Original filename, or null when the attachment had none.
data.attachment_manifest.content_type
nullable string
必填
MIME content type, or null when it could not be determined.
data.attachment_manifest.size
integer
必填
Attachment size in bytes.
data.reference_ids
array of string
必填
RFC 5322 References header entries used to thread the conversation.
data.labels
array of string
必填
Labels applied to this message. A message carries at most 20 labels.
data.contact_id
nullable string
必填
Contact linked to this message, or null when none is linked.
data.source
object
必填
Link to the message's entry in the received-message or sent-message log, which carries delivery analytics such as per-recipient events. Log entries expire 30 days after the message occurred.
显示子属性
data.source.resource
string
必填
API path of the log entry for this message.
data.source.available_until
string
必填
When the log entry (and the message's original rendered source) expires.
data.occurred_at
string
必填
When the message was received or accepted for sending.
next_cursor
nullable string
必填
Cursor for the next page. Pass back as starting_after to advance forward. Null when no next page exists.
prev_cursor
nullable string
必填
Cursor for the previous page. Pass back as ending_before to step backward. Null when no previous page exists.
refresh_cursor
nullable string
必填
Refresh anchor. Pass back as ending_before later to fetch items that have appeared since this response. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.