Standardized Pagination

In general, there are three types of pagination that every API uses:

  1. Page and pageSize
  2. Limit and offset
  3. Cursor

We try to create a standard means of paginating in each connector, and in general page and pageSize is our preferred method because it is easy to use and flexible.

Limit and offset can easily be converted to page and page size (pageSize = limit; page = offset/limit). However, cursor-based pagination can not be so easily converted. Cursor pagination is where you call GET /accounts and it returns a nextPageToken. This token is used on the next request to get the next page.

Even though we want to use page/page size pagination across the board, it is not always possible. For this reason, you will find support for cursor-based pagination everywhere in our platform. Every connector supports cursor-based pagination no matter what. That way, you can maintain consistency in your integrations. So, if you have a connector that must be cursor based, you can use cursor-based for every connector.

Every GET /<anyObject> returns the following header:

 elements-next-page-token: eyJwYWdlU2l6ZSI6MiwicGFnZSI6Mn0

And on every one of these APIs, even if it's not documented you can send the query parameter nextPage=eyJwYWdlU2l6ZSI6MiwicGFnZSI6Mn0 and it will work the same as if you had sent page and pageSize.

Related Links