Pagination & filtering
The API uses cursor-based pagination for efficient navigation through large datasets. Most list endpoints also support date filters and sorting.
Pagination
Parameters
| Parameter | Description |
|---|---|
before | Cursor/document ID to paginate before (previous page) |
after | Cursor/document ID to paginate after (next page) |
limit | Page size (endpoint-specific defaults, max: 1000) |
hasCount | Include total counts (may increase response time) |
Default limits
| Endpoint | Items per page |
|---|---|
| Customers | 20 |
| Activities | 10 |
| Rewards | 10 |
Navigate between pages
Use the item ID from responses:
- Next page: send the last item's ID as
after. - Previous page: send the first item's ID as
before.
# First page
curl "https://api.joy.so/rest_api/v2/customers?limit=20&hasCount=true"
# Next page (using last item's ID from previous response)
curl "https://api.joy.so/rest_api/v2/customers?after=abc123&limit=20"
# Previous page (using first item's ID)
curl "https://api.joy.so/rest_api/v2/customers?before=abc123&limit=20"The response carries meta.pagination (hasNext, hasPre, and total / totalPage when hasCount=true). See Response format.
Filter by date
Most list endpoints support these date filters:
| Parameter | Description |
|---|---|
created_at_min | Filter records created after this date |
created_at_max | Filter records created before this date |
updated_at_min | Filter records updated after this date |
updated_at_max | Filter records updated before this date |
Sort results
order sets the sort order. Values vary by endpoint; common values are createdAt_desc, createdAt_asc, updatedAt_desc and updatedAt_asc.
Example with filters
curl "https://api.joy.so/rest_api/v2/customers?\
created_at_min=2023-01-01T00:00:00Z&\
created_at_max=2023-12-31T23:59:59Z&\
order=createdAt_desc&\
limit=50"