Skip to main content
POST
Answer a question from the knowledge base

Authorizations

Authorization
string
header
required

Dashboard JWT token from Clerk

Headers

Idempotency-Key
string

Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the Idempotency-Replay: true response header.

Required string length: 1 - 255
X-Test-Mode
enum<string>

Sandbox opt-in for Clerk-session-authenticated requests. Set to true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.

Available options:
true,
false

Body

application/json
question
string
required

The end-user question to answer (1-2000 chars).

Required string length: 1 - 2000
knowledge_base_ids
string[]

Optional knowledge-base allowlist. When present, retrieval is scoped to these KBs only; when omitted, the whole workspace knowledge base is searched. Max 20 ids.

Maximum array length: 20
Required string length: 1 - 120
limit
integer
default:8

Max chunks retrieved to ground the answer (1-10). Defaults to 8.

Required range: 1 <= x <= 10
threshold
number

Optional retrieval similarity floor (0-1) passed through to the vector search.

Required range: 0 <= x <= 1
min_confidence
number

Confidence floor (0-1) above which an answer is charged as a billable resolution. Defaults to the platform bar (0.75); a lower-confidence answer is still returned but not billed.

Required range: 0 <= x <= 1
language
string

Optional language tag (e.g. en, pt-BR) — the answer is written in this language.

Required string length: 2 - 10
audiences
string[]

The audience tokens (roles / segments) the end-user belongs to, used to enforce per-document access control. Omit / empty = anonymous requester → only unrestricted documents are eligible. Max 50.

Maximum array length: 50
Required string length: 1 - 120

Response

Successful response.

data
object

The echoed question, answered (whether the KB could answer it), the grounded answer, its confidence (0-1), the citations it was drawn from, and a usage block describing the metered resolution.

meta
object