ioZen Docs

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

ParameterTypeDefaultMaxDescription
limitinteger50100Number of items per page
cursorstringCursor 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..."
    }
  }
}
FieldTypeDescription
has_morebooleantrue if there are more results after this page
next_cursorstring | nullCursor 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 items

Important Notes

  • Maximum limit is 100. Requests with limit > 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 limit while has_more is still true.

On this page