Pagination
The Rewind Public API uses cursor-based pagination to navigate large datasets.
Pagination Parameters
All paginated endpoints support these query parameters:
limit (optional)
- Type: Integer
- Range: 1-50
- Default: 25
- Description: Maximum number of items to return per page
cursor (optional)
- Type: String
- Description: Opaque pagination cursor for the next page. Pass back the
next_cursorvalue from the previous response; leave empty for the first page. - Usage: Use the
next_cursorvalue from the previous response
order (optional, accounts and audit_logs endpoints only)
- Type: String
- Values:
ascordesc - Default:
desc - Description: Sort direction on the endpoint's primary timestamp. Case-sensitive; any other value returns 422. Changing
ordermid-pagination has no effect until you restart from the first page.
Response Format
Paginated responses include both data and pagination metadata:
{
"data": [
{
"id": "acc_1234567890abcdef",
"name": "mystore.myshopify.com",
"backup_status": "success",
"platform": "shopify",
"service_type": "backup"
}
],
"pagination": {
"limit": 25,
"next_cursor": "q7Xz2Kd9pLm4Rn8Tv0Wc1a"
}
}
Pagination Fields
- limit: The page size you requested, clamped to the range 1-50.
- next_cursor: Opaque token for the next page.
nullmeans you have reached the last page.
Usage Examples
First Page Request
curl "https://developer.rewind.com/api/v1/accounts?limit=25" \
-H "X-API-Key: YOUR_API_KEY"
Response
{
"data": [
{ "id": "acc_1234567890abcdef", "name": "store1.myshopify.com", ... },
{ "id": "acc_2345678901bcdefg", "name": "store2.myshopify.com", ... }
],
"pagination": {
"limit": 25,
"next_cursor": "q7Xz2Kd9pLm4Rn8Tv0Wc1a"
}
}
Next Page Request
curl "https://developer.rewind.com/api/v1/accounts?limit=25&cursor=q7Xz2Kd9pLm4Rn8Tv0Wc1a" \
-H "X-API-Key: YOUR_API_KEY"
Error Handling
Invalid Cursor Error
{
"title": "Bad Request",
"status": 400,
"detail": "Invalid cursor provided",
"instance": "/api/v1/accounts",
"request_id": "req_123"
}
Solution: Start over from the first page without a cursor.
Troubleshooting
Common Issues
- "Invalid cursor" error: The cursor may be malformed. Restart from the first page.
- Fewer results than expected: Check
next_cursor. If it is non-null, there are more pages. Keep paging until it isnull.
Debugging Tips
- Always check the
next_cursorvalue before making the next request - Log cursor values to track pagination progress
- Monitor for 400 errors indicating cursor issues
- Use smaller page sizes for initial testing