Skip to main content
POST
Run Sql

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

project_id
string | null

Target project for the request. Required when authenticating with a user session token (a user credential is only meaningful scoped to a project); for an API key it is optional and, if given, must match the key's project.

Body

application/json

A public SQL query. The project is never part of this body.

extra="forbid" is the point rather than tidiness: scope is resolved from the credential, so a body carrying project_id or a scope_* key is a caller trying to choose a tenant. Forbidding unknown keys turns that into a 422 instead of a silently ignored field.

query
string
required

A single read-only SELECT over the public schema

Required string length: 1 - 65536
max_rows
integer | null

Rows to return, clamped down to the server ceiling

Required range: 1 <= x <= 1000000
parameters
Parameters · object | null

Values for {name:Type} placeholders in the query

Response

Successful Response

A completed query, already trimmed to what the caller may receive.

columns
SqlColumn · object[]
required
elapsed_ms
integer
required
row_count
integer
required
rows
any[][]
required
truncated
boolean
required

True when more rows matched than were returned

statistics
Statistics · object