Skip to main content
POST
Create a deep search

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Deep search creation parameters

knowledge_base
object
required

Knowledge base configuration. Determines which content to search.

Three source modes are supported:

  • collections: Search within specific collections
  • files: Search specific files by URL or file ID (uses default index)
  • default: Search all default-indexed files for the account
query
string
required

The search query.

Minimum string length: 1
scope
enum<string>
default:segment

The scope of results to return. 'segment' returns individual segments, 'file' returns file-level results. When the knowledge base contains any metadata collections, scope must be 'file' (metadata collections only index file-level documents).

Available options:
segment,
file
limit
integer
default:20

Maximum number of results to return. Actual count may be lower when exclude_weak_results is enabled.

Required range: 1 <= x <= 500
exclude_weak_results
boolean
default:false

When true, removes results tagged as weak matches by the synthesis LLM.

include
enum<string>[]

Additional fields to include in the response. 'search_queries' includes the intermediate search query plan.

Available options:
search_queries
stream
boolean
default:false

Stream the response via SSE. Mutually exclusive with background.

background
boolean
default:false

Process in the background. Returns immediately with status 'in_progress'. Mutually exclusive with stream.

Response

Deep search created successfully

id
string<uuid>

Deep search ID

object
enum<string>

Object type identifier

Available options:
deep_search
status
enum<string>

Current status of the deep search

Available options:
in_progress,
completed,
failed,
cancelled
created_at
number

Unix timestamp of when the deep search was created

query
string

The original search query

scope
enum<string>

The scope of the search results

Available options:
segment,
file
text
string | null

LLM-generated synthesis text summarizing the results

results
object[] | null

Array of search results

total
integer

Total number of results

limit
integer

Maximum number of results requested

search_queries
object[] | null

Intermediate search query plans (included when requested via include=['search_queries'])

usage
object | null

Token and search call usage

error
object | null

Error details if the deep search failed