Skip to main content
The ChatGrid API uses cursor-based pagination for all list endpoints. This approach is more reliable than offset pagination when data is being created or deleted between requests.

Query parameters

The Messages endpoint defaults to order=asc (chronological) instead of desc. All other endpoints default to desc (newest first).

Response format

Every list response includes pagination metadata:

Fetching all pages

To iterate through all results, keep fetching while has_more is true:

How cursors work

Cursors are base64url-encoded JSON containing the id and created_at of the last item on the current page. The server uses these values for a keyset query, which is efficient even on large datasets. Cursors are opaque — do not decode or construct them manually. They may change format without notice. Always use the cursor value returned by the API.

Tips

  • Start with a reasonable limit. 50 is a good default. Use 100 only if you need to minimize round trips.
  • Cursors do not expire but they become invalid if the referenced row is deleted. If you receive an invalid_cursor error, restart pagination from the beginning.
  • Combine with filters. You can use cursor alongside filters like type, node_id, source_node_id, or status. The cursor is always relative to the filtered result set.