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

# Pagination and search

> How list endpoints of the Klatt API are paged, how to poll conversations efficiently and how searching works.

List endpoints use one of three forms. Each operation in the reference says which.

## Cursor pagination

Conversations (newest first) and contacts are returned one page at a time.

* `limit` sets the page size, from 1 to 100 (default 50).
* `cursor` continues from where the previous page stopped.
* The response contains `items` and `next_cursor`. When `next_cursor` is `null`, there are no more pages.

```bash theme={null}
# First page
curl "https://api.klatt.ai/api/v1/conversations?limit=50" \
  -H "Authorization: Bearer $KLATT_API_KEY"

# Next page: pass next_cursor from the previous response
curl "https://api.klatt.ai/api/v1/conversations?limit=50&cursor=<next_cursor>" \
  -H "Authorization: Bearer $KLATT_API_KEY"
```

Treat cursors as opaque: do not parse or build them, and send them back unchanged with the same filters. A malformed or altered cursor answers `422` with `invalid_cursor`. A contact cursor is also tied to its list: use it only for the list that returned it.

Contact pages also return `total`, the number of contacts that match.

### Polling conversations

The conversation list response carries an `ETag`. Send it back in `If-None-Match` to get `304 Not Modified` with no body while nothing changed. Use `since` (an ISO 8601 date and time) to ask only for conversations changed after that moment. Each conversation has an `updated_at` you can use to track the latest change.

## Offset pagination

Knowledge documents use `limit` (1 to 100, default 100) and `offset` (the number of documents to skip). Request the next page by adding `limit` to the previous `offset`; stop when a page returns fewer documents than `limit`.

## No pagination

These operations return every item as a JSON array in one response: voice agents, chat agents, transfer targets, contact lists, contact fields and knowledge entries.

## Search

Searching is a `POST` with the search text in the JSON body, so that it stays out of URLs, browser history and logs that record URLs:

```bash theme={null}
curl https://api.klatt.ai/api/v1/conversations/search \
  -H "Authorization: Bearer $KLATT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "<text to look for>", "limit": 50}'
```

Search results are paged with `cursor` in the body, in the same way as lists. Sending the search text as a `q` query parameter to a list endpoint is refused with `422` and `search_moved_to_post`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.