Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pagination, Filtering, and Sorting

Public list endpoints expose their own pagination and filtering fields. Use the endpoint’s response to determine whether more records remain.

Read every page without inventing cursors

Python pattern with an authenticated requests session and your own process function. Keep page settings unchanged and pass next_cursor back exactly as returned.

Copy the example
params = {"page_size": 50, "direction": "next"}
while True:
    response = session.get(
        f"{base_url}/v2/knowledge-bases", params=params
    )
    response.raise_for_status()
    page = response.json()
    process(page["data"])
    cursor = page.get("next_cursor")
    if not cursor:
        break
    params["cursor"] = cursor

Before you begin

The operation’s public request and response schema.

Key concepts

Term
Definition

Pagination

Retrieval of a collection through multiple pages. Use the continuation method exposed by the selected operation.

Cursor

A continuation value returned for the next page on cursor-based endpoints. Treat it as opaque; do not manufacture it from a display name or record count.

Offset

A numeric starting position used by some list operations. Keep filtering and ordering consistent while moving through pages.

Configuration options

Option
Purpose
Behavior

Page size

The maximum number of records requested or processed in one page.

It is not a guarantee that all records in the collection are included.

Filter

A condition that narrows the records eligible for an operation.

A filter can exclude relevant content before ranking occurs.

Request a filtered page of results

  1. Set supported filters and page-size fields.

  2. Read the returned collection and continuation information.

  3. Request further pages using the documented method and stop at completion.

The client retrieves the intended records without relying on a single page.

Behavior and limitations

Not all endpoints support the same filters, sorting, or cursor format. A limit is usually a page limit rather than a complete result count. Keep filters consistent between pages. Handle records changing during collection and avoid assuming an unspecified sort order is stable.

API Versions and Compatibility

Was this helpful?