Skip to main content
post/knowledge-fs/query-stream
Request example
Response
post/knowledge-fs/query-stream

Authorization

Authorizationstringheaderrequired#

The query token returned by Create Query Token, sent as Authorization: Bearer {token}. Use it before the returned expires_at time, at most 60 seconds after issue. It authorizes only Run Query on that knowledge base.

Send X-Trace-ID on the same request, with the trace_id that Create Query Token returned.

Headers

X-Trace-IDstringrequired#
The trace_id from the Create Query Token response, the same value as the token's trace_id claim. A value that does not match the token is rejected with 403. See Query the Knowledge Base.

Body

application/json
activeDocumentIdsstring[]#
Copied from the returned request object. These IDs do not filter or rank retrieved content.

Items: max 100

activeEntityIdsstring[]#
Copied from the returned request object. These IDs do not filter or rank retrieved content.

Items: max 100

knowledgeSpaceIdstringrequired#
Internal ID of the knowledge base, copied from the request object of Create Query Token. Must match the token. A mismatch is rejected with 403.

Length: min 1

modeenum<string>#
Retrieval depth, copied from the request object of Create Query Token. null is accepted and means the knowledge base's default depth.
Options:fastdeepresearchnull
querystringrequired#
The question. Use a nonblank query. Also limited to 16,384 UTF-8 bytes.

Length: max 16000Pattern: \S

sessionIdstring#
Session ID, copied from the request object of Create Query Token.

Responses

text/event-stream
The stream opened. Events follow as text/event-stream, whatever Accept the request sends. Before the stream opens, handle failures as HTTP errors. After it opens, handle an answer.error event as failure even though the HTTP status is 200.