Sign inGet Started

List messages in a WhatsApp conversation

GET
/v1/whatsapp/conversations/{conversation_id}/messages
const messages = await bird.whatsapp.conversations.listMessages("wacv_01krdgeqcxet5s7t44vh8rt9mg", {
  direction: "inbound",
});
for (const message of messages.data ?? []) {
  console.log(message.id, message.created_at);
}
प्रतिक्रिया200
{
  "data": [
    {
      "id": "wam_01krdgeqcxet5s7t44vh8rt9mh",
      "direction": "outbound",
      "from": {
        "phone_number": "+15550001234"
      },
      "to": {
        "phone_number": "+15550001111",
        "bsuid": "US.13491208655302741918"
      },
      "text": {
        "body": "Yes. Reply with the new address and we will update it."
      },
      "status": "delivered",
      "created_at": "2026-09-23T10:37:12Z",
      "sent_at": "2026-09-23T10:37:13Z",
      "delivered_at": "2026-09-23T10:37:14Z"
    },
    {
      "id": "wam_01krdgeqcxet5s7t44vh8rt9mg",
      "direction": "inbound",
      "from": {
        "phone_number": "+15550001111",
        "bsuid": "US.13491208655302741918",
        "display_name": "Jamie Rivera"
      },
      "to": {
        "phone_number": "+15550001234"
      },
      "text": {
        "body": "Can I change the delivery address on my order?"
      },
      "status": "received",
      "created_at": "2026-09-23T10:35:00Z"
    }
  ],
  "next_cursor": null,
  "prev_cursor": null,
  "refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9"
}

Returns the messages in one conversation, newest first, as a cursor-paginated list. They are the same messages the WhatsApp message list returns, already narrowed to this conversation's number and contact, so each one carries the content object it was built from and its current delivery status.

Filter by direction to read only what the contact sent or only what was sent to them. Pass the response's next_cursor back as starting_after for the next page.

Messages are retained for 30 days. When a conversation's last message expires, the conversation and its events are deleted too, and the conversation returns 404. The contact's next message starts a new conversation with a new ID. There is no way to read messages older than the window.

पैरामीटर

conversation_idstring

Conversation identifier. Starts with wacv_.

Query पैरामीटर

directionstring

Return only messages the contact sent (inbound) or only messages sent to them (outbound). Omit for both.

Possible values: outbound, inbound

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.

Response Payload

data
array of object
आवश्यक

Page of WhatsApp messages, newest first.

चाइल्ड एट्रिब्यूट दिखाएँ
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, 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.

इस विषय के लिए दस्तावेज़, गाइड और उदाहरणों के साथ आगे बढ़ें।