Pagination, filters and synchronising
Page through lists with a cursor, filter and sort, and keep changes in sync.
Lists
A list response has data (the objects) and meta (the pagination):
{
"data": [],
"meta": {
"limit": 50,
"next_cursor": "eyJpZCI6IjlkM2Y2YzFlIn0",
"prev_cursor": null
}
}Paging with a cursor
Request the next page with the next_cursor from the previous response:
curl "https://app.klantly.com/api/v1/customers?limit=100&cursor=eyJpZCI6IjlkM2Y2YzFlIn0" \
-H "Authorization: Bearer $KLANTLY_API_KEY"When next_cursor is null, you are on the last page. A cursor points to a position in the sort order, not to a page number: records added in between do not shift anything. If you sort by updated_at, a record that changes while you page can show up again further on, so deduplicate on id. A cursor belongs to one sort order: do not use it with a different sort. limit ranges from 1 to 100; the default is 50.
Filtering and searching
Filters go in filter[...], for example filter[status]=lead or filter[email]=jan@example.com. With q you search several fields at once. Which filters exist is listed per endpoint in the API reference. An unknown filter returns a validation error.
Sorting
sort=created_at sorts ascending, sort=-created_at descending. Descending by creation date is the default.
Synchronising
To keep your own system up to date, periodically fetch what has changed:
- Remember the moment of your previous synchronisation.
- Request
filter[updated_since]=<that moment>&sort=updated_atand go through all pages. - Store the new moment.
Tip
Use a small overlap, for example one minute, so you never miss a change that happened exactly during your previous run.
Last updated on September 15, 2026