# Pagination

> Move through domain collections and email activity without losing your place.

## Page-based collections

[Email domains](/docs/api/email-domains/list) accept `page` and `limit`. Start with page `1`; `limit` defaults to `50` and accepts values from `1` to `100`.

```shell
curl "https://api-connect.nxiom.com/api/v1/emails/domains?page=1&limit=50" \
  -H "Authorization: Bearer $NEXIOM_API_KEY"
```

The result is nested under `data`. An empty collection looks like this:

```json
{
  "message": "Email domains fetched",
  "data": {
    "items": [],
    "total": 0,
    "page": 1,
    "limit": 50
  }
}
```

Increment `page` until `page × limit` reaches `total`. Keep your filters unchanged between requests.

## Cursor-based email logs

[Email logs](/docs/api/emails/list) use an opaque `cursor`, not page numbers. Omit it for the first request. Pass the returned `nextCursor` unchanged, URL-encoded, on the next request.

```shell
curl "https://api-connect.nxiom.com/api/v1/emails/logs?limit=50" \
  -H "Authorization: Bearer $NEXIOM_API_KEY"
```

```typescript
const url = new URL('https://api-connect.nxiom.com/api/v1/emails/logs');
url.searchParams.set('limit', '50');
if (nextCursor) {
  url.searchParams.set('cursor', nextCursor);
}
```

Stop when `hasMore` is `false`. `total` may be `null`; do not rely on a total count to continue. Preserve filters when following a cursor, and start again without a cursor when filters change.

---

Source: https://connect.nxiom.com/docs/api/pagination
