Skip to main content
Search conversations finds conversations by text, by filters, or by both. It covers every source, including the chat widget, WhatsApp and the API.

Quick start

With 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 its id to Export conversations:

Paging

Keep every parameter the same, add the cursor, 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.
A cursor only works with the search that produced it. Changing any parameter other than 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 429 with a Retry-After header.
  • 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 as chatbase_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:
CodeHTTPDescription
VALIDATION_SEARCH_WINDOW_EXCEEDED400A date is before the 12-month search window. The message gives the window’s start.
VALIDATION_CURSOR_QUERY_MISMATCH400The cursor came from a search with different parameters. Restart without a cursor.
VALIDATION_INVALID_CURSOR400The cursor is malformed. Pass pagination.cursor exactly as returned.
VALIDATION_INVALID_DATE_RANGE400A start date is after its end date.
CONVERSATION_SEARCH_UNAVAILABLE403The account is HIPAA-enabled or the AI agent redacts conversation data, so query isn’t allowed. Search with filters only.
CONVERSATION_SEARCH_BUSY503Search timed out or is overloaded. Retry after a short delay.