Skip to navigation

Preview query

View as Markdown

Runs read-only SQL against the workspace’s analytics views without saving a widget. Use it to develop a query. Side-effect free despite being a POST.

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. Preview has no board, so there are no defaults: every token outside an optional [[...]] block needs a value here.

row_limitintegerOptional1-10000Defaults to 1000

Maximum rows, 1–10000. Default 1000. A LIMIT in your SQL also applies and is capped at 1000.

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 rows returned reached the row limit, so the result may have been cut. Also true when your own LIMIT is reached exactly.

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