Sign inGet Started

List WhatsApp messages

GET
/v1/whatsapp/messages
for await (const msg of bird.whatsapp.list({ status: ["delivered"] })) {
  console.log(msg.id, msg.status);
}
Réponse200
{
  "data": [
    {
      "id": "wam_01kya1b3xdq7fe8m2v5t9rncgs",
      "direction": "inbound",
      "from": {
        "phone_number": "+15550002222",
        "bsuid": "US.AbC1",
        "display_name": "Dana Reyes"
      },
      "to": {
        "phone_number": "+15550001111",
        "group_id": "wag_01krdgeqcxet5s7t44vh8rt9mg"
      },
      "text": {
        "body": "Got it, thanks."
      },
      "status": "received",
      "created_at": "2026-09-15T14:05:41Z"
    },
    {
      "id": "wam_01kya19eknftrs2s6p82asmvnh",
      "direction": "outbound",
      "from": {
        "phone_number": "+15550001111"
      },
      "to": {
        "group_id": "wag_01krdgeqcxet5s7t44vh8rt9mg"
      },
      "text": {
        "body": "The route sheet for Tuesday is up."
      },
      "status": "delivered",
      "recipient_count": 2,
      "delivered_count": 2,
      "read_count": 1,
      "created_at": "2026-09-15T14:03:10Z"
    }
  ],
  "next_cursor": null,
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9"
}

Returns the workspace's WhatsApp messages as a cursor-paginated list, newest first, outbound and inbound alike. Each message carries the one content object it was built from: template, or free-form text, image, video, audio, sticker, document, location, interactive or contact_cards. An inbound message carries interactive_reply when the contact tapped a reply button or a list row, on an interactive message or on a template's quick reply. An inbound message whose content WhatsApp models and we do not carries unsupported instead, naming the type rather than reading back empty. Filter by direction, status, recipient (to), sender (from), business-scoped user ID (bsuid), group (group_id), template category, tag, or creation time. to and from name the same ends of the message the response does, and each accepts an E.164 phone number or a business-scoped user ID. Pair either with direction to search a single side of the message. Neither matches a group, so group_id is what narrows the list to one group's messages. Pass the response's next_cursor back as starting_after to fetch the next page. To follow a single message's delivery, use Get a WhatsApp message instead.

Messages are retained for 30 days. A created_after earlier than that is accepted and raised to the retention bound rather than rejected, so a wider window returns what is still retained instead of failing. There is no way to read messages older than the window.

Paramètres de requête

limitinteger

Maximum number of items to return per page.

starting_afterstring

Cursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.

ending_beforestring

Cursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.

created_afterstring

Limits the response to resources created at or after this timestamp. Combine it with created_before to select a time window. Use an RFC 3339 timestamp with a timezone offset.

created_beforestring

Limits the response to resources created before this timestamp. Combine it with created_after to select a time window. Use an RFC 3339 timestamp with a timezone offset.

statusarray

Filter by status. Repeat the parameter to match any of several statuses.

directionstring

Filter by whether the business sent the message (outbound) or received it from the contact (inbound).

Possible values: outbound, inbound

tostring

Filter by recipient, exact match. The recipient is the contact on an outbound message and your business number on an inbound one, matching the to each message returns. Accepts an E.164 phone number, or a business-scoped user ID to name the contact. Only a contact is ever identified by a business-scoped user ID, so to=<business-scoped user ID> matches outbound messages only.

fromstring

Filter by sender, exact match. The sender is your business number on an outbound message and the contact on an inbound one, matching the from each message returns. Accepts an E.164 phone number, or a business-scoped user ID to name the contact. Only a contact is ever identified by a business-scoped user ID, so from=<business-scoped user ID> matches inbound messages only.

phone_numberstring

Deprecated: use to or from instead, which also match a business-scoped user ID. Filters by contact phone number (E.164 exact match), in either direction.

bsuidstring

Filter by business-scoped user ID (Meta identifier), matching the contact in either direction. to and from also accept one, but each matches a single end of the message.

categorystring

Filter by category.

Possible values (may grow over time): authentication, utility, marketing

group_idstring

Filter by the WhatsApp group the message belongs to, in either direction: the group an outbound message was addressed to, or the group an inbound message arrived through. Matches the group_id on each message's to. It names one group, so there is no way to ask for the messages that belong to no group: omit it to list group and one-to-one messages together.

tagarray

Filter by tag. Accepts name to match any record carrying that tag name, or name:value to match a specific tag pair (for example category:welcome). Repeat the parameter to add more tags. A record must match every tag listed to be returned.

Contenu de la réponse

data
array of object
obligatoire

Page of WhatsApp messages, newest first.

Afficher les attributs enfants
data.id
string
obligatoire

ID of the message, assigned when the send is accepted. Pass it as message_id to the get-message and list-events endpoints.

data.direction
string
obligatoire

Whether the message was sent by the business (outbound) or received from the contact (inbound).

Possible values: outbound, inbound

data.from
object
obligatoire

Sender of the message. On outbound messages, the business number it was sent from; on inbound, the WhatsApp contact.

Afficher les attributs enfants
data.to
object
obligatoire

Recipient of the message. On outbound messages, the WhatsApp contact; on inbound, the business number.

Afficher les attributs enfants
data.template
object

The template the message was sent from. For authentication templates the filled-in values are not returned.

Afficher les attributs enfants
data.text
object

Text the message carried.

Afficher les attributs enfants
data.image
object

Image the message carried.

Afficher les attributs enfants
data.video
object

Video the message carried.

Afficher les attributs enfants
data.audio
object

Audio the message carried.

Afficher les attributs enfants
data.sticker
object

Sticker the message carried.

Afficher les attributs enfants
data.document
object

Document the message carried.

Afficher les attributs enfants
data.location
object

Location the message carried.

Afficher les attributs enfants
data.contact_cards
array of object

Contact cards on this message: cards the contact shared, either by tapping a button that asked for their number or by sending one from their address book, or the cards this workspace sent.

Afficher les attributs enfants
data.interactive
object

Interactive content the message carried. Outbound only: a contact cannot send one. A tap on a reply button or a list row reads back as interactive_reply on the contact's inbound message; a cta_url link sends nothing back, and the two request kinds are answered by an inbound location or contact_cards message.

Afficher les attributs enfants
data.in_reply_to_message_id
string

The message this one answers. On an inbound message it is what WhatsApp reports as the reply's target: a tap on a button or a list row, and equally a text or media message the contact sent as a quoted reply. An outbound message echoes the in_reply_to_message_id it was sent with. Absent when the message answers nothing, and absent on an inbound message whose target we cannot match to a message we hold, which is the case for one sent before this workspace started recording them or one already past the 15-day window we keep provider ids for.

data.interactive_reply
object

What the contact tapped, on a message answering an interactive message or a template's quick-reply button. Inbound only.

Afficher les attributs enfants
data.unsupported
object

Set when a message that did not come from a Bird send carries content we do not model, naming the WhatsApp content type so the message is not silently empty. Never on a message sent through Bird.

Afficher les attributs enfants
data.reactions
array of object

Emoji reactions standing on this message right now, one per sender. Absent when the message has none. A reaction that was replaced by a different emoji, or taken back, is not listed; the message's reaction log keeps that history. WhatsApp accepts a reaction on a message up to 30 days old, and we keep provider ids for 15, so a reaction placed on a message older than that cannot be matched to it and does not appear here.

Afficher les attributs enfants
data.status
string
obligatoire
data.origin
string

Where the message came from when it did not come through Bird live. Absent when your workspace sent the message through Bird, or the contact sent it to Bird.

data.recipient_count
integer

How many recipients a group send was addressed to, taken when the send was accepted. It is the group's membership at that moment, not its membership now: someone joining through the invite link while the message is in flight does not receive it and does not change this count.

Absent on a one-to-one message, along with delivered_count and read_count. A message with one recipient has no fan-out to report, and its delivery is what status, delivered_at and read_at already say. Absent for the same reason on a group message sent before Bird recorded the count, and on a send to a group nobody had joined yet: there is no denominator to report, and none can be recovered after the fact, since membership has moved on. to.group_id is what tells a group message from a one-to-one one in every case, including those two. With no denominator to resolve against, status is read as stored, the way a one-to-one message's is: it reaches sent when the message is handed to WhatsApp and stops there, because delivery is confirmed per participant and a send with no participants collects no confirmations.

It is also the denominator status is resolved against: on a group message status reports the furthest point every recipient has reached, so it turns delivered only once delivered_count equals this number, and stays sent while some have confirmed and others have not. failed and rejected are never per recipient: there is one hand-off to the WhatsApp network and one way for that to be refused. delivered_at and read_at are the first recipient's, not the last.

data.delivered_count
integer

How many of the recipient_count recipients WhatsApp has confirmed the message reached. A recipient who reported only a read counts here too: WhatsApp skips the delivery receipt when someone is already looking at the chat, so waiting for one would leave that person uncounted for ever.

Absent on a one-to-one message, which has no fan-out to count, and on a group message with no recipient_count to count against.

data.read_count
integer

How many of the recipient_count recipients have opened the message. Read receipts do not move status, which has no read value; they surface here and in read_at.

Absent on a one-to-one message, which has no fan-out to count, and on a group message with no recipient_count to count against.

data.last_error
nullable object

Failure detail for a message that did not reach the recipient. Present only when the message failed or was rejected.

Afficher les attributs enfants
data.created_at
string
obligatoire

When the message was accepted for delivery.

data.sent_at
nullable string

When the message was handed to the WhatsApp network. Null until then.

data.delivered_at
nullable string

When delivery was confirmed. Null until then.

data.read_at
nullable string

When the message was read. On an outbound message this is the recipient opening it. On an inbound one it is when Bird acknowledged the message to WhatsApp for the business, which a read receipt sets. Null until then.

data.cost
nullable object

What the message cost, split into Bird's charge and any third-party fees passed through. Null on an inbound message, which is never priced, on an outbound message that has not been priced yet, and on one rejected before pricing. The rate depends on the message category and the recipient's country.

Afficher les attributs enfants
data.tags
array of object

Structured {name, value} filter labels applied to this message.

Afficher les attributs enfants
data.metadata
object

Arbitrary JSON metadata stored on the message.

next_cursor
nullable string
obligatoire

Cursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.

prev_cursor
nullable string
obligatoire

Cursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.

refresh_cursor
nullable string
obligatoire

Refresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.