Create Query Token
Authorization
Path parameters
…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.Body
application/jsonItems: max 100
Items: max 100
fast, deep, or research (see Retrieval Depth). Omit it (or send null) to use the knowledge base's default depth, retrieval.default_mode in Get Knowledge Base Settings.fastdeepresearchnullLength: max 16000Pattern: \S
ID of a query session, as a UUID. Omit it to start a new session. Run Query returns the session ID in its x-session-id response header.
A session stores the last 20 queries but doesn't carry them into later answers. It expires after 30 minutes without a query.
An expired or unknown ID starts a fresh session under that ID, so a UUID you generate yourself stays valid as that session's ID.
Responses
createQuery, the operation the token is valid for. Callers can ignore it.Query token for Run Query on this knowledge base, good until expires_at. Send it as Authorization: Bearer <token>.
Create a new token for each call, including a retry.
It is a signed JWT. Read trace_id from this response for the X-Trace-ID header; you do not need to decode the token.
X-Trace-ID header of Run Query. It equals the token's trace_id claim. It is not the query record ID.