> ## Documentation Index
> Fetch the complete documentation index at: https://developers.flowestate.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Standard query parameters for list endpoints, and how to walk through every page.

List endpoints accept these query parameters:

| Param       | Type            | Default     | Notes                                                                  |
| ----------- | --------------- | ----------- | ---------------------------------------------------------------------- |
| `limit`     | integer 1..100  | `50`        | Page size.                                                             |
| `offset`    | integer ≥ 0     | `0`         | Number of records to skip.                                             |
| `query`     | string          | —           | Free-text search across name, email, company, phone (where supported). |
| `sortBy`    | string          | `createdAt` | Endpoint-specific. See each endpoint.                                  |
| `sortOrder` | `asc` \| `desc` | `desc`      |                                                                        |

## Walking through pages

```js theme={null}
async function* iterateLeads(apiKey) {
  let offset = 0;
  const limit = 100;
  while (true) {
    const res = await fetch(
      `https://panel.flowestate.app/api/v1/leads?limit=${limit}&offset=${offset}`,
      { headers: { Authorization: `Bearer ${apiKey}` } }
    );
    const { data, pagination } = await res.json();
    for (const lead of data) yield lead;
    if (!pagination.hasMore) break;
    offset += limit;
  }
}
```

Stop when `pagination.hasMore` is `false`.

## Filters

Most list endpoints accept additional filter parameters on top of the standard ones — for example `status` and `source` on `/leads`. Filter parameters are listed per endpoint in the [API Reference](/api-reference/overview).

## Notes

* **Don't cache offsets across long-lived sessions.** New records are inserted at the top (sorted by `createdAt desc` by default), so an offset that pointed at "page 5" yesterday is no longer the same window today. Re-paginate from scratch.
* **For large exports**, consider sorting `sortBy=createdAt&sortOrder=asc` and paginating chronologically. That way new inserts don't shift your position.
* **`limit` is capped at 100.** Higher values are silently clamped.
