Preview query

View as Markdown

Executes read-only SQL against the workspace’s analytics views and returns the rows. Use it to develop a query before creating a widget from it. Safe and side-effect free despite being a POST: the SQL and filter values are too large and too structured for a query string. Tenant scoping is enforced server-side and cannot be bypassed.

Path parameters

org_idstringRequired
Organization ID
workspace_idstringRequired
Workspace ID

Headers

X-API-KeystringRequired
Your workspace API key.

Request

This endpoint expects an object.
sqlstringRequired>=1 character

Read-only SELECT; same filter-token syntax as widget SQL

filter_valuesmap from strings to objectsOptional

Values for the tokens in sql, keyed by token name

row_limitintegerOptional1-10000Defaults to 1000

Maximum rows returned. Optional — omit it for the default of 1000. A LIMIT inside your SQL can narrow the result further but never widens it past this. The result reports truncated when this cut the result short.

Response

Successful Response
columnslist of objects

Column metadata in result order; position N describes position N of every row

rowslist of lists of any

Row values as positional arrays aligned 1:1 with columns, not keyed objects

row_countinteger

Number of rows in rows, which is not the total matched when truncated

truncatedboolean

True when the result was cut short by row_limit

execution_msinteger
Query execution time in milliseconds, excluding network transfer

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
408
Request Timeout Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error