Query

Run a read-only SQL query

Execute one SELECT through the read-only SQL sandbox.

The statement must be a single SELECT over data.* tables you can access, name every table in restrict_tables, and fit the sandbox's function allowlist and cost bounds. Rows are capped by row_limit, execution by a server-side statement timeout, and the result's size before it leaves the database: truncated is true when either cap cut rows. A result whose first row alone exceeds the size cap, or whose response would exceed 8 MiB, is refused with 422.

post/query/

Request

  • The document declares no server URL.
  • Auth: one of:
    • OAuth 2 (password, token URL /api/auth/login)
    • API key in header X-Api-Key
    • API key in query parameter api_key

Request body

sqlstring required

A single SELECT statement over data.* tables.

restrict_tablesstring[] required

Table names (without the data. prefix) the query may touch. Required and non-empty; intersected with your access — it can only narrow what you already see, never widen it.

row_limitinteger

Maximum rows to return.

Response

Successful Response

columnsstring[] required
row_countinteger required
truncatedboolean required

Changes

No recorded changes to this operation across all 50 revisions of this API.