Pagination
Navigate through lists of resources with cursor-based pagination.
Pagination
All list endpoints in the send0 API use cursor-based pagination. This provides stable, consistent results even when new data is being created between page requests.
Response shape
Every list endpoint returns the same pagination structure.
{
"data": [
{ "id": "em_abc1", "subject": "Welcome", "status": "delivered" },
{ "id": "em_abc2", "subject": "Invoice #42", "status": "sent" }
],
"has_more": true,
"cursor": "cur_xxxx"
}| Field | Type | Description |
|---|---|---|
data | array | The list of resources for the current page |
has_more | boolean | Whether more results exist after this page |
cursor | string | Cursor to pass for the next page (only present when has_more is true) |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Number of results per page (max 100) |
cursor | string | — | Cursor from the previous response to fetch the next page |
Using the SDK
let cursor: string | undefined;
do {
const { data, has_more, cursor: nextCursor } = await send0.emails.list({
limit: 20,
cursor,
});
for (const email of data) {
console.log(email.id, email.subject);
}
cursor = has_more ? nextCursor ?? undefined : undefined;
} while (cursor);Using curl
Fetch the first page:
curl https://api.send0.dev/v1/emails?limit=20 \
-H "Authorization: Bearer sk_live_..."Fetch the next page using the cursor from the previous response:
curl https://api.send0.dev/v1/emails?limit=20&cursor=cur_xxxx \
-H "Authorization: Bearer sk_live_..."Continue fetching pages until has_more is false.
Why cursor-based?
Cursor-based pagination is more reliable than offset-based pagination for APIs where data changes frequently.
- Stable results. New records created between page requests don't cause duplicates or skipped items.
- Consistent performance. Cursors are backed by indexed lookups, so page 1,000 is as fast as page 1.
- No count overhead. Offset pagination requires counting rows, which gets slower as data grows.
Note: send0 never supports offset-based pagination. All list endpoints use cursors exclusively.