Skip to main content
All list endpoints (GET /messages, GET /contacts, GET /templates, and so on) share the same cursor-based pagination.

Request parameters

ParameterDescription
limitNumber of results to return, between 1 and 100. Defaults to 20.
starting_afterA cursor for use in pagination. Pass the id of the last object from the previous page to fetch the next one.

Response shape

{
  "object": "list",
  "data": [
    { "id": "msg_3p2k9q", "...": "..." },
    { "id": "msg_8h1n2v", "...": "..." }
  ],
  "has_more": true
}
has_more is true if there are additional results after the ones returned. When it’s false, you’ve reached the end of the list.

Paging through every result

let startingAfter;
const allMessages = [];

while (true) {
  const page = await pulsewave.messages.list({ limit: 100, starting_after: startingAfter });
  allMessages.push(...page.data);

  if (!page.has_more) break;
  startingAfter = page.data[page.data.length - 1].id;
}
Lists are always ordered most-recent-first by creation time. There is no way to page backwards from a cursor — request the previous page again without starting_after advanced as far, or store cursors as you go.