Pagination
List endpoints return results in pages. Vantax uses cursor-based pagination, which stays stable as records are created or deleted while you page.
Every endpoint that returns a collection — agents, contacts, calls, and the like — is paginated. Rather than offset/page numbers, Vantax uses cursor-based pagination: you walk through results by pointing at the last object you have seen. Because the cursor is a real object id, results don't shift or duplicate when records are added or removed mid-iteration, the way they can with offset paging.
Request parameters
Paginated endpoints accept two optional query parameters, passed in the URL query string:
limit— the number of items to return per page. Defaults to20and may not exceed100. Values above the maximum are clamped to100.starting_after— a cursor for use in pagination. It is the id of an object (for exampleagt_3d9b21). The page returned will contain the items that come after that object in the result ordering. Omit it to fetch the first page.
A request for the page following agent agt_3d9b21:
starting_aftermust be the id of an object that belongs to the same collection and is reachable by your API key's scope. An unknown or out-of-scope id is rejected rather than silently ignored.Response shape
List responses follow the standard envelope: data holds the array of items for the current page, and a pagination object describes the result set.
The pagination object contains:
total— the total number of items across all pages that match the request.limit— the effective page size applied to this response (after any clamping).has_more—truewhen further pages remain. Keep paging while this istrue; stop when it isfalse.next_cursor— when present, the id to pass asstarting_afteron your next request. It is equivalent to the id of the last item indata, provided for convenience.
Paging through results
To collect an entire result set, request the first page, then keep passing the id of the last item you received as starting_after until has_more is false. The loop below uses the maximum page size to minimize round trips:
next_cursor, you can use it directly instead of reading the last item's id — both point to the same object.Best practices
- Drive the loop with
has_more. Don't infer the end of the set from a short page or fromtotalarithmetic — a page can be short and still have more results. Stop only whenhas_moreisfalse. - Use a larger
limitfor bulk reads. Fetching100items per page reduces the number of requests and the time spent paging through large collections. - Treat cursors as opaque object ids.Pass back exactly what the API gave you. Don't construct, decode, or modify a cursor — its format is an object id today and should not be parsed.
- Persist cursors to resume. For long-running or interrupted jobs, store the last cursor you processed so you can pick up where you left off rather than re-reading from the first page.
- Keep filters constant across pages. Any query filters must stay identical on every request in the sequence;
starting_afteronly makes sense within a single, consistent query. - Be mindful of rate limits. When paging through many results, handle
429responses with backoff so a large iteration doesn't exhaust your quota.