Pagination
Navigate large result sets with cursor-based pagination.
List endpoints use cursor-based pagination to efficiently navigate large result sets. Unlike offset-based pagination, cursors are stable — new items added between pages don't cause duplicates or skipped results.
Query Parameters
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 50 | 100 | Number of items per page |
cursor | string | — | — | Cursor from a previous response's next_cursor |
Response Format
Every paginated response includes a pagination object:
{
"success": true,
"data": {
"intake_bots": [...],
"pagination": {
"has_more": true,
"next_cursor": "clxyz123..."
}
}
}| Field | Type | Description |
|---|---|---|
has_more | boolean | true if there are more results after this page |
next_cursor | string | null | Cursor to pass in the next request, or null if no more pages |
Iterating Through All Pages
JavaScript
async function fetchAllIntakeBots(apiKey) {
const items = [];
let cursor = undefined;
do {
const url = new URL('https://app.iozen.ai/api/v1/intake-bots');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const response = await fetch(url, {
headers: { Authorization: `Bearer ${apiKey}` },
});
const { data } = await response.json();
items.push(...data.intake_bots);
cursor = data.pagination.next_cursor;
} while (cursor);
return items;
}Python
import requests
def fetch_all_intake_bots(api_key: str) -> list:
items = []
cursor = None
base_url = "https://app.iozen.ai/api/v1/intake-bots"
headers = {"Authorization": f"Bearer {api_key}"}
while True:
params = {"limit": 100}
if cursor:
params["cursor"] = cursor
response = requests.get(base_url, headers=headers, params=params)
data = response.json()["data"]
items.extend(data["intake_bots"])
if not data["pagination"]["has_more"]:
break
cursor = data["pagination"]["next_cursor"]
return itemsImportant Notes
- Maximum
limitis 100. Requests withlimit> 100 are clamped to 100. - Cursors are opaque strings. Don't parse, construct, or modify them.
- Results are ordered by creation date (newest first) unless otherwise noted.
- Cursors should be used promptly. While cursors don't have a strict expiration, database changes (deletions) may invalidate them over time.
- Empty pages are possible. If items are deleted between requests, a page may return fewer items than
limitwhilehas_moreis stilltrue.