Skip to main content
POST
query_tables

Authorizations

X-API-Key
string
header
required

Headers

prefer
string | null
Idempotency-Key
string | null

Replaying a request with the same key returns the original job with 200, never a second job. The key is kept with the job for replay and never cleared, so it must not contain personal data.

Maximum string length: 200

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier.

Body

application/json

Question over a bounded set of workspace-uploaded table selections.

Every row's path must name a table file — a spreadsheet (xlsx, xls, xlsm, xlsb, ods) or record file (csv, tsv, parquet, jsonl, ndjson, json); a document, media, or image path is refused with invalid_request naming qa-file. Every tab is askable whatever its ingestion produced — extracted rows, a rendered sheet, or both.

paths
QueryTableSelection · object[]
required
Required array length: 1 - 32 elements
query
string
required
Required string length: 1 - 4096
include_citations
boolean
default:true
output_schema
Output Schema · object | null

A JSON Schema (Draft 2020-12, object root, local non-recursive $ref only, no pattern, patternProperties or unevaluated*) the answer must follow. When set, the agent writes answer as JSON text conforming to it, the run checks that and asks the agent to correct a mismatch, and the result carries the parsed value in structured_answer. A field the source does not state comes back null, whatever type the schema gives it. Explanation goes to reasoning where the result has one, and evidences are unchanged. If the answer still misses the schema, the run succeeds with answer as written and structured_answer null. Omit for a prose answer.

Response

Successful Response

Answer, provenance, unavailable inputs, and retained result previews.

Two lanes fill this shape. An all-queryable selection runs the SQL engine and returns everything: tables previews, result_citations, and SQL receipts in citations. A selection holding tabs without extracted rows runs a QA agent over the files' rendered sheets and row extractions together — the answer and quoted citations are filled, while tables and result_citations stay empty (no SQL results exist to retain). unavailable reports selections with no usable content on either lane.

job_id is the durable job row created for this run; retrieve it via GET /v1/jobs/{job_id} to inspect or replay the stored answer.

answer
string
required
citations
Evidence · object[]
confidence
enum<string> | null

The engine's self-graded confidence in the answer — how well the queried tables support it, on the shared six-level scale (certain / very_high / high / medium / low / speculative). Null when the engine could not grade (a timeout's partial answer, a legacy run).

Available options:
certain,
very_high,
high,
medium,
low,
speculative
error
string | null
job_id
string<uuid> | null
result_citations
QueryTableCitation · object[]
result_materialization_error
string | null
structured_answer
any | null

answer parsed as JSON, set only when the request carried output_schema and the answer validates against it; a field the source does not state is null whatever type the schema gives it. Null on every run without a schema, and on a run whose answer still missed the schema after its corrections, where answer holds the text as written.

tables
QueryTablePreview · object[]
timed_out
boolean
default:false
unavailable
UnavailableTable · object[]