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
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
limit | integer | 20 | Results per page (max 100) |
Request
Response metadata
| Field | Description |
|---|---|
pagination.total | Total number of matching records |
pagination.page | Current page number |
pagination.limit | Results per page |
pagination.totalPages | Total number of pages |
Iterating through all pages
Offset-based pagination
Used by:GET /v1/suppressions
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
offset | integer | 0 | Number of records to skip |
limit | integer | 50 | Results per page (max 100) |
Request
Response metadata
| Field | Description |
|---|---|
pagination.total | Total number of matching records |
pagination.offset | Current offset |
pagination.limit | Results per page |
pagination.hasMore | true if more results exist beyond the current page |
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.