Skip to main content
GET
List a business's chats

Autorizações

Authorization
string
header
obrigatório

Personal access token (izap_pat_…) sent as Authorization: Bearer ; dashboard session JWTs are also accepted.

Cabeçalhos

business-id
string | null
obrigatório

UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.

Parâmetros de consulta

kind
string
padrão:trainer

Filter by Chat.kind. 'trainer' (default) returns sandbox conversations from the AI Trainer UI; 'real' returns customer conversations created from WhatsApp webhooks; 'all' returns both. The default is 'trainer' to preserve the historical behavior of this endpoint, which was trainer-only via a consumer-nickname heuristic.

page
integer
padrão:1

1-based page number for chat pagination (used by the trainer's infinite scroll).

Intervalo obrigatório: x >= 1
page_size
integer
padrão:30

Number of chats to return per page (default 30, max 100).

Intervalo obrigatório: 1 <= x <= 100
messages_per_chat
integer
padrão:1

How many of the most-recent messages to embed per chat. Defaults to 1, which is enough for the list's last-message preview and ordering. Full conversation threads should be fetched on demand from GET /chats/{chat_id}/messages (paginated) rather than over-fetched here — embedding the whole thread for every chat on the page made this endpoint load thousands of messages per request.

Intervalo obrigatório: 1 <= x <= 200
refine_queue
string | null

Refine trainer queue filter for kind=real. 'pending' = no OK review and no issues; 'reviewed' = has OK review or any issue.

chatbot_id
string<uuid> | null

Optional assistant ID to filter chats by (per-assistant trainer from dash).

since
string<date-time> | null

ISO-8601 timestamp. When set, only chats whose last activity (the same timestamp this list orders by) is strictly newer than since are returned — exclusive, not inclusive, so polling with since=<last seen timestamp> never returns a chat already seen. For incremental sync: pass the newest timestamp from the previous response as since on the next poll instead of refetching and diffing a full page client-side.

Resposta

Successful Response

chats
ChatOut · object[]
obrigatório
pagination
PaginationMeta · object
obrigatório