Skip to main content
The search endpoint retrieves documents semantically relevant to a query. It is part of the public API and can be called directly without creating a chat session.
This endpoint searches chat session history, not the document index. To search your connected documents and knowledge sources, use the chat API with a search-enabled agent. The admin search endpoint (POST /api/admin/search) provides direct document search for administrative use.

Search chat sessions

Searches through the authenticated user’s chat sessions by query text, grouped by time period.

Query parameters

string
The search query. If omitted, returns the most recent sessions.
integer
default:"1"
Page number (1-indexed).
integer
default:"10"
Number of results per page.

Response

array
Sessions grouped by recency.
boolean
Whether more results are available on the next page.
integer
The next page number if has_more is true, otherwise null.

Searches the document index directly. Requires admin or curator role.

Request body

string
required
The search query string.
object
required
Search filters.

Response

array
Matching documents ordered by relevance.

Error codes