Pagination patterns
Gorillaa Mail list endpoints support two pagination patterns depending on the endpoint:Page-based pagination
Used by:GET /v1/emails, GET /v1/domains
Parameters
Request
Response metadata
Iterating through all pages
Offset-based pagination
Used by:GET /v1/suppressions
Parameters
Request
Response metadata
Iterating with offset
Best practices
Use the largest reasonable page size
Use the largest reasonable page size
Request
limit=100 to minimize the number of API calls. Each call counts against your rate limit.Stop when you have enough
Stop when you have enough
If you only need the first 50 results, don’t paginate beyond that. Use filters to narrow results.
Use filters to reduce result sets
Use filters to reduce result sets
Most list endpoints support filters like
status, from, startDate, endDate, or reason. Filtering is faster and cheaper than paginating through everything.Handle empty pages gracefully
Handle empty pages gracefully
If
data is an empty array, you’ve reached the end — stop paginating.