Skip to main content
POST
run_sql

Authorizations

X-API-Key
string
header
required

Path Parameters

workspace_id
string<uuid>
required

Workspace identifier.

Body

application/json

One read-only SELECT over the workspace's queryable tables.

Table names come from metadata — file-metadata publishes each queryable tab's table_name and folder-metadata's table census lists them all — and from earlier run-sql results (every response's res_… handle is a registered table on the next call, so results can be joined, aggregated, or paged with LIMIT/OFFSET). Joins across files are ordinary SQL joins. A statement that is not a read, or that reads an unregistered table, is refused with invalid_request naming the rule and the registered tables.

sql
string
required
Required string length: 1 - 4096

Response

Successful Response

One executed statement: shape, bounded preview, and the retained result.

The stored result is complete whatever the preview shows; result_citation.result_file.download_url fetches the whole parquet. duplicate marks a statement answered from an earlier identical run's stored result — free, and safe to build on.

result
QueryTablePreview · object
required

One retained result table with a bounded inline preview.

sql
string
required

The normalized statement that ran — the result's provenance.

duplicate
boolean
default:false
result_citation
QueryTableCitation · object | null

Provenance for one generated TablesQA result file.

result_materialization_error
string | null
source_paths
string[]

The uploaded files the statement read — carried on the response itself so source attribution survives when no result file is materialized (job-attributed agent statements).