Quick start
query, the best matches come first, and results carry a snippet unless the match was only in the title. Without query, the most recently active conversations come first and snippet is null.
Examples
Different filters must all match. Comma-separated values inside one filter match any of them. Every word in
query must match, so refund chargeback only finds conversations that contain both words. To find either word, run two searches.
Filters
Dates accept
YYYY-MM-DD (a whole UTC day) or a full ISO 8601 timestamp.
Snippets
A snippet is one excerpt, about 180 characters, from the best-matching message.speaker says whether the user or the AI agent wrote it. Join the value fields to get the plain text, and highlight the parts where isHit is true.
Reading a conversation
Search returns conversation details without messages. To read a result’s messages, pass itsid to Export conversations:
Paging
Keep every parameter the same, add thecursor, and stop when hasMore is false. A page can hold fewer results than limit, sometimes none, while hasMore is still true. That happens when conversations were deleted after they were indexed, so keep following the cursor.
limit while paging returns VALIDATION_CURSOR_QUERY_MISMATCH.
Limits
- 12 months. Search covers conversations created since the first day of the month 12 months ago (UTC). For older conversations, use Export conversations.
- 10 searches per second per account. Above that you get a
429with aRetry-Afterheader. - A few seconds behind. New messages take a few seconds to become searchable.
- HIPAA and redacted AI agents can’t use
query. Filters still work. - Permissions. If your API key is scoped, it needs
chatlogs:export.
MCP
The Chatbase MCP server exposes search aschatbase_search_conversations. It accepts up to 5 searches in one call through a searches array and returns the results in the same order.
Error codes
Search-specific error codes beyond the standard authentication and rate-limiting errors:| Code | HTTP | Description |
|---|---|---|
VALIDATION_SEARCH_WINDOW_EXCEEDED | 400 | A date is before the 12-month search window. The message gives the window’s start. |
VALIDATION_CURSOR_QUERY_MISMATCH | 400 | The cursor came from a search with different parameters. Restart without a cursor. |
VALIDATION_INVALID_CURSOR | 400 | The cursor is malformed. Pass pagination.cursor exactly as returned. |
VALIDATION_INVALID_DATE_RANGE | 400 | A start date is after its end date. |
CONVERSATION_SEARCH_UNAVAILABLE | 403 | The account is HIPAA-enabled or the AI agent redacts conversation data, so query isn’t allowed. Search with filters only. |
CONVERSATION_SEARCH_BUSY | 503 | Search timed out or is overloaded. Retry after a short delay. |
