Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

API Key or JWT User Token. If using an API Key, set the X-As-User header to act as a specific user. A JWT User Token is always scoped to a specific user.

Body

application/json
query
string
required

Query to run.

answer
boolean
default:false

If true, the query will be answered along with matching source documents.

provenance
boolean
default:false

If true (effort='very_high' only), attach a provenance record to the response: the source documents and entities the answer was grounded in, the agent's search trajectory, and any sources that failed. Adds one indexed lookup; intended for auditability / compliance use cases.

cross_user
boolean
default:false

Alpha: opt this agentic query into cross-user scope. Requires the app admin to have enabled cross-user retrieval in the app's settings, the 'brain-cross-user-agentic-alpha' flag on the app, a per-user token, an agentic effort tier ('medium' or 'high'), and answer=true. Matching documents are never returned in this mode — the only output is the synthesized answer, passed through the app's category filter and accompanied by a privacy disclaimer. If any requirement is missing the query runs user-scoped and a notice is added to errors.

effort
enum<string>
default:minimal

How much compute to spend on retrieval. Mirrors the dial popularized by frontier-model APIs (OpenAI reasoning_effort, etc.). 'minimal' = verbatim single-shot retrieval (fastest). 'low' = LLM rewrites the query for better retrieval and extracts date filters. 'medium' = rewrite + agentic refinement loop (the answer LLM may request additional retrieval rounds, up to 3). 'high' = rewrite + extended refinement (up to 6 rounds). Higher = better recall, more latency, more cost.

Available options:
minimal,
low,
medium,
high,
very_high
sources
enum<string>[]

Only query documents from these sources. Names are case-insensitive and accept either separator, so Google Drive's provider may be given as google_drive, google-drive, or GOOGLE_DRIVE.

Available options:
reddit,
notion,
slack,
google_calendar,
google_mail,
google_meet,
box,
dropbox,
github,
gitlab,
google_drive,
vault,
web_crawler,
trace,
microsoft_teams,
granola,
fathom,
fireflies,
linear,
hubspot,
salesforce,
coda,
confluence,
jira,
lightfield,
gong,
pylon,
clickup
options
QueryOptions · object

Search options for the query.

max_results
integer
default:10
deprecated

Maximum number of results to return.

Required range: 1 <= x <= 200

Response

Successful Response

query_id
string | null

The ID of the query. This can be used to retrieve the query later, or add feedback to it. If the query failed, this will be None.

errors
Errors · object[] | null

Errors that occurred during the query. These are meant to help the developer debug the query, and are not meant to be shown to the user.

documents
ScoredDocumentResponse · object[]

The matching documents, each carrying its hyperdoc tree plus query-path score/highlights/summary (ENG-2479 Phase 4).

answer
string | null

The answer to the query, if the request was set to answer.

disclaimer
string | null

Privacy notice, set when the query ran in cross-user alpha mode: the answer may draw on other members' data and category filtering is best-effort. Show this to the end user alongside the answer.

provenance
Provenance · object | null

Auditability record (source documents, entities, search trajectory, failed sources), if the request set provenance=True on a very_high query.

citations
CitationCandidate · object[] | null

Sources the answer cites, in first-mention order. Each entry resolves an inline [SRC-n] marker in the answer text to the source document it refers to. Present only when the answer-citations flag is on for the app and the answer actually cited something.

score
number | null

The average score of the query feedback, if any.

query
string | null

The query string that was issued.