> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ndi.nace.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Cursor lists versus offset folders

Most NDI list routes are **keyset cursor** pages. A few folder-style listings
are **offset** pages. Do not mix the two.

## Cursor pages

`list` methods return `{ items, next_cursor }`. Pass `?cursor=` (or the SDK
`cursor=` argument) to fetch the next page. `next_cursor` is `null` on the
last page.

The Python and TypeScript SDKs expose `iter_all` / `iterAll` for:

* workspaces
* files
* jobs
* domains

Access labels use `iter_access_labels` / `iterAccessLabels`.

```python theme={"dark"}
from ndi_sdk import NdiClient

with NdiClient() as client:
    for workspace in client.workspaces.iter_all(name_contains="audit"):
        print(workspace.workspace_id, workspace.name)
```

Do not invent page numbers. The cursor is opaque.

## Offset pages

These two listings use `offset` / `limit` (or `start_after` / `page_size`):

* `GET /v1/workspaces/{id}/files/{file_id}/outputs/{output_id}/members`
* `POST /v1/workspaces/{id}/tools/folder-metadata`

`folder_metadata` also accepts `start_after` to resume a path-sorted page.

## Filtered search

`POST /v1/workspaces/{id}/filtered-search` pages with a discriminated body:
the first call is `{ "type": "query", ... }`; later pages send
`{ "type": "page", "cursor": "..." }`. The Python SDK wraps that as
`client.search.filtered` and `client.search.filtered_page`. The TypeScript SDK
does not yet wrap filtered search — call the HTTP route.
