Pagination

Send limit to choose the page size. To read the next page, pass the returned nextPageToken as pageToken. Stop when nextPageToken is absent or null.

{
  "status": "success",
  "data": [
    { "id": "Xq8mTe2LwP4kZ1aB9cDf", "name": "Sales" },
    { "id": "Rk2pLm9QxT7vB4nC1dEf", "name": "Support" }
  ],
  "nextPageToken": "eyJvZmZzZXQiOjIwfQ"
}

On lists that use data, read their items from that field. Some lists group items by workspace; check each endpoint’s response.

Example

for await (const agent of platic.agents.iterate()) {
  console.log(agent.name);
}

Parameters

ParameterDescription
limitHow many items you want per page
pageTokenThe nextPageToken from the previous page

The allowed range of limit and its default are on each list's page. For example, List agents takes 1 to 100 and defaults to 20.

Rules

  • When nextPageToken is absent or null, there are no more pages.
  • Send the pageToken with the same filters and the same ?workspace= (or without it, if the first page didn't carry it). With different ones, the answer is 400.
  • A page can contain fewer than limit items and still have another page. If you receive nextPageToken, use it to continue.
  • Short lists, such as the eval scenarios of a workspace, come complete and without nextPageToken.
  • On contacts, V1 conversations, chats and campaigns, pageToken can't be combined with offset: the answer is 400 with the problem in details.issues.

Conversations V2

List conversations, the messages of a conversation and Search conversations use the same limit, pageToken and nextPageToken, with a few extra rules:

ListlimitOrder
List conversations1 to 200, default 50lastActivityAt (default) or createdAt, newest first by default
Messages of a conversation1 to 100, default 20Creation date, newest first by default
Search conversations1 to 100, default 10Rank order, up to candidateLimit (250 by default)
{
  "status": "success",
  "data": [
    { "id": "conv_1", "contactName": "Ana", "operation": "supervised" }
  ],
  "nextPageToken": "eyJrIjoiY29udl8xIn0",
  "pagination": { "limit": 20, "returnedCount": 1, "hasMore": true },
  "meta": { "fields": ["id", "contactName", "operation"], "include": [], "requestId": "req_123" }
}
  • nextPageToken is always present. It is null on the last page. pagination.hasMore says the same thing.
  • Follow the token, not the page length. A page can be shorter than limit, or even empty, and still have a nextPageToken: conversations you can't see or that were deleted are left out.
  • Same filters, same order, same workspace. A pageToken sent with other filters, another order, another workspace or another credential answers 400 INVALID_CURSOR. limit, fields and include may change between pages.
  • No offset. V2 lists only page with tokens.
  • The list is live. A conversation whose lastActivityAt changes between pages can move position. Messages, sorted by their creation date, don't move.

Search sessions

A search ranks its results once and keeps that ranking for 15 minutes. Send the same body with pageToken to read the next page. After 15 minutes the token answers 410 SEARCH_SESSION_EXPIRED: repeat the search without pageToken. Each page is checked again, so a conversation deleted or out of your reach since the first page is left out. Pages never go past candidateLimit.

Invalid note type. Should be either "note", "tip", "important", "warning", "caution"