Skip to main content
POST
Python SDK

Access

This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must grant one of tenant.view, tenant.data.query.providers.

Errors

  • HTTP 400: The SQL, query parameters, or reading is not valid, or Parable cannot plan the SQL. The message gives the reason, and the code is a QL code. Correct the query using the stated reason.
  • HTTP 403: The caller may not run this SQL, under the same rules as a Plot preview (PA-AU-019). Use an identity that may run the SQL, or estimate only what you may read.
  • HTTP 404: The requested Parable ref or published pin is not available in this Workspace. Check the ref or commit ID and Workspace context.

Authorizations

Authorization
string
header
required

A personal access token, which starts with pat_. A Parable token can call each operation that the roles of its owner allow. An MCP token can call only the read operations that are open to agents. A SQL token does not work on this API.

Headers

X-Tenant
string

Workspace slug. Overrides subdomain-based workspace resolution when provided.

Example:

"acme"

X-Request-ID
string<uuid>

Optional request correlation ID echoed back in the response.

Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json

One SQL statement to run once against the Workspace's data. The operation caps no rows. The result is every row the statement returns, up to the query row limit, which fails the query rather than truncating it (QL-SQ-005). To read fewer rows, write a LIMIT in the SQL. A reader may also stop reading early: the Parable app stops at its display limit and an MCP tool call at 3 MiB of Arrow.

sql
string
required

Single SQL statement. Text.Sql rejects empty; maxLength is 100000 bytes.

Required string length: 1 - 100000
Pattern: ^[\s\S]*$
commitId
string | null

UUID v4 with automatic base62 encoding for client-facing APIs

Pattern: ^([0-9A-Za-z]{1,22}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
expectedRefRevision
integer<int64> | null

Draft definition revision observed by the React host. Requires refId; execution refuses a stale revision instead of relabeling old code as new. Omitted means the caller deliberately requests the latest authorized ref.

Required range: 1 <= x <= 9007199254740991
jev
object

Jev defaults for this query only. SQL model arguments override the default. The null policy applies to recoverable input, provider and response failures.

parameters
any[] | null

Positional values for $1, $2, ... placeholders, sent through Flight SQL prepared-statement binding. Values are never interpolated into SQL. Each value is a JSON scalar (string, finite number, boolean, or null). Omitted/null/empty uses the ordinary unparameterized query path.

Any valid JSON value: object, array, primitive, or null

reading
object

Host-selected data reading. Omitted raw SQL requests Current; a bound React Plot always sends its canonical context.data. Unsupported Report execution is refused explicitly rather than silently relabeled as Current.

refId
string | null

Where the Plot runs. At most one of the two: refId is the ref being viewed (a Proposal draft, or a Personal-mode root), commitId is a published line's pin. Parable uses them to choose the Parable-scope rows that workspace.preferences serves. Both absent means the Plot reads no Preferences.

Pattern: ^([0-9A-Za-z]{1,22}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$

Response

Successful response

data
object
required

The answer to a SQL dry run.

meta
object
required