Pagination
Navigate large result sets with cursor-based pagination.
Overview
List endpoints in the SalesOS API return paginated results. The API uses offset-based pagination with configurable page sizes.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
limit | integer | 20 | Items per page (max 100) |
sortBy | string | createdAt | Field to sort by |
sortOrder | string | desc | Sort direction: asc or desc |
Example Request
Response Format
Paginated endpoints return an array of items:
The total count is returned in the response headers:
Filtering
Most list endpoints support filtering via query parameters:
Best Practices
- Use reasonable page sizes (20-50 items) for optimal performance
- Always handle the case where a page returns fewer items than the limit (end of results)
- Cache results client-side when browsing back and forth between pages
- Use
sortByandsortOrderto get the most relevant results first - Combine pagination with filters to reduce the total result set