v1

latestOpenAPI 3.0.02026-08-04891301.4 MB

Search context items within a thread

Performs a full-text search over context items (messages, files, and other indexed sources) attached to the specified thread. Returns tagged objects whose content matches the query string.

Use the type param to restrict results to a particular context source. All accessible context source types are searched when type is omitted. The authenticated user must have access to the thread.

get/api/v1/threads/{thread}/search

Path parameters

threadstring required

Thread ID (thr_...). Must be accessible to the authenticated user.

Query parameters

typestring

Context source type to restrict the search to, e.g. "thread/messages". Omit to search across all context sources for the thread.

qstring required

Full-text search query. Results are ranked by relevance to this string.

Response

Successful response

dataobject[] required

Array of matching context items. Each item is a tagged object whose shape depends on the source type.

Example response

{
  "data": [
    {}
  ]
}