Fix
Short answer: List endpoints return one page at a time. Loop through pages with page_number and a sensible page_size instead of requesting everything at once.
Why it happens
- List endpoints are paginated. List all dataset records returns 10 records per page by default.
- With
apply_preference=true, List all process items (Admin) applies the process's saved preferences, including filters, shown fields and rows per page. That can cap the page at 100. - A huge page size, such as
page_size=9999999, makes the server try to return everything at once. The request drops with a503or times out with a524. - Filters saved on a list in the UI, such as portal users, also apply to the API response.
How to fix it
- Request one page at a time, for example
?page_number=1&page_size=1000, thenpage_number=2, and so on, until a page comes back short or empty. - For very large sets, add a short delay between calls.
- Leave out
apply_preferenceunless you want the saved filters and page size. - If a list returns fewer records than you expect, check for filters saved on that list or dataset in the UI.
If you call the API from a page or form with kf.api():
- Remember that
kf.api()calls time out after 10 seconds, so keep pages small. - List all process items (Admin) needs the Process Admin role. A non-admin user who clicks a button that calls it gets a permission error. Run the call from an integration instead, for example one started by a webhook.
See API and SDK documentation for each endpoint's parameters.
Tip
To count items before you page through them, use the count endpoint, for example Retrieve report item count.
