Skip to main content
The CharityStack API uses cursor-based pagination on all list endpoints. Rather than using page numbers, each response gives you a token you can pass to the next request to continue where you left off. This approach is reliable even when records are added or updated between requests.

How it works

Every list endpoint accepts two optional query parameters: Each response includes:
The lastEvaluatedKey token is opaque — do not parse or construct it manually. Always use the value returned directly from the previous response.

Endpoints that support pagination

Cursor-based pagination is available on the following endpoints:
  • GET /v1/payments
  • GET /v1/subscriptions
  • GET /v1/contacts
  • GET /v1/forms
  • GET /v1/analytics/webhook-logs
  • GET /v1/analytics/api-metrics

Step-by-step walkthrough

1

Make your first request

Call the list endpoint without a lastEvaluatedKey. You can optionally set limit to control how many records are returned per page (up to 100).
The response will look like this:
2

Check hasMore

If hasMore is true, more records exist beyond this page. If hasMore is false, you have received all available records and you can stop.
3

Pass lastEvaluatedKey for the next page

Include the lastEvaluatedKey value from the previous response as a query parameter in your next request.
Repeat this process until hasMore is false.

Full example: fetch all payments in a loop

The following examples show how to paginate through all payments programmatically.
Set limit to 100 when you need to fetch all records as quickly as possible. This minimizes the number of API requests and helps you stay within the rate limit of 1,000 requests per hour.