Skip to main content
Concepts

Pagination

How to walk through large lists with a cursor or with page and limit.

Cursor

Lists return the items and a nextCursor. Pass the value as after to fetch the next page; when nextCursor comes back null, you are done. The cursor stays stable even while new items arrive.

GET /emails
curl "https://api.coffeemail.com.br/v1/product/emails?limit=100" -H "Authorization: Bearer $COFFEEMAIL_API_KEY" # { "emails": [ … ], "nextCursor": "eyJpZCI6Ijg…" } curl "https://api.coffeemail.com.br/v1/product/emails?limit=100&after=eyJpZCI6Ijg…" -H "Authorization: Bearer $COFFEEMAIL_API_KEY"

Page and limit

Some lists accept page and limit and return pagination with total, page, limit and totalPages. On very large lists, total may be an estimate (totalIsEstimate).

  • limit goes up to 100 per page.
  • Prefer the cursor to scan everything and page for numbered screens.