Pagination
All list endpoints support pagination to manage large result sets efficiently.Basic Usage
Pagination Parameters
The maximum
page[size] is 100. If you need to retrieve more results, use multiple paginated requests.Response Format
All paginated endpoints return results in the same format:Pagination Examples
Iterating Through Pages
Loading a Specific Page
Pagination with Filters
Sorting
Control the order of results with thesort parameter. Sorting works with both direct parameters and JSON filters.
Basic Usage
Sort Format
Common Sort Fields by Endpoint
Cases (/v1/cases)
created_at- Creation timestampupdated_at- Last update timestamptitle- Case titlestatus- Custom status valueparent_status- Parent statuswaiting_for- Who the case is waiting forreference- Custom reference numberarchived_at- Archive timestamp
Case Templates (/v1/case_templates)
created_at- Creation timestampupdated_at- Last update timestamptitle- Template titlereference- Custom referencearchived_at- Archive timestamp
Forms (/v1/forms)
created_at- Creation timestampupdated_at- Last update timestamp- Various custom fields based on form template
Form Templates (/v1/form_templates)
created_at- Creation timestampupdated_at- Last update timestamp
Sorting Examples
Sort by Date
Sort by Title
Sort with JSON Filter
Dynamic Sorting
Combining Pagination and Sorting
Pagination and sorting work together seamlessly:Best Practices
Use appropriate page sizes
Use appropriate page sizes
- Use larger page sizes (50-100) for batch processing
- Use smaller page sizes (10-25) for UI display
- Consider network latency and processing time
Always implement pagination
Always implement pagination
Never assume a dataset is small. Always implement pagination to avoid:
- API timeouts
- Memory issues
- Poor user experience
Sort by indexed fields
Sort by indexed fields
Sorting by
created_at or updated_at is typically faster than custom fields. Use these when possible for better performance.Cache sorted results
Cache sorted results
If sorting by the same field repeatedly, consider caching the results to reduce API calls.
Handle empty results
Handle empty results
Always check if the
data array is empty:Use total_count for UI feedback
Use total_count for UI feedback
Show users how many total results exist:
Complete Example: Data Table
Here’s a complete example of implementing a paginated, sortable data table:Next Steps
Advanced Filters
Learn how to filter results with operators
List Cases
Apply pagination to the Cases endpoint
List Forms
Paginate and sort forms
OpenAPI Spec
See all available sort fields