import json
import os
from parable_types_web_api import ImmediatePlotQueryInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = ImmediatePlotQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.parables.execute_immediate_plot_query(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.ImmediatePlotQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParablesNamespace.ExecuteImmediatePlotQuery(ctx, input)"<string>"{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Preview a Plot
Runs a Plot’s query once and returns the rows it produces, without saving a Report. Use it to see what a Plot would show before relying on it. With a Parable’s refId or commitId, the SQL reads that Parable’s Plots under their Panes’ Policies; only someone who may edit the Parable reads other pools from there, and never under View as. No row cap applies beyond the query row limit, which fails the query (QL-SQ-005); write a LIMIT in the SQL to bound the rows. Over HTTP the response body is an Arrow IPC stream (application/vnd.apache.arrow.stream) that is complete only when it ends with the IPC end-of-stream marker; a body that ends without it failed. A refusal is an RFC 9457 problem (application/problem+json). A tool caller receives ImmediatePlotQueryResult, holding at most 3 MiB of the stream’s Arrow, with rowCount and truncated.
import json
import os
from parable_types_web_api import ImmediatePlotQueryInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = ImmediatePlotQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.parables.execute_immediate_plot_query(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.ImmediatePlotQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParablesNamespace.ExecuteImmediatePlotQuery(ctx, input)"<string>"{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}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 oftenant.view, tenant.data.query.providers.
Errors
HTTP 400: The SQL, query parameters, reading, or selected data does not satisfy the Plot contract. When Parable refuses the SQL, the message gives the reason, and the code is a QL code, such as QL-PL-002 for a relation or table function the catalog does not serve. Correct the query using the stated reason, and select a valid current or Report reading.HTTP 403: The caller, selected Workspace, or API token is not allowed to run this query. PA-AU-019 marks a refusal of the person’s access: SQL that names no Parable needs the Provider Pools Reader or Data Access role; SQL in a Parable needs a seat on it and permission to read Parables, and reads beyond its Plots only with permission to edit it and a Publishing or Primary seat on it, never under View as; and a Plot’s Pane Policies or a Provider Policy can refuse a table the SQL reads. Read only the Parable’s Plots, or run the SQL without refId or commitId with the Provider Pools Reader or Data Access role, or use an identity with permission to edit the Parable and a Publishing or Primary seat on it.QL-TN-007: The SQL names a Plot whose rows a Report run stored (a stored Refresh), and Provider Policies or source permissions narrow what the caller reads of a Provider table behind it. The Refresh holds rows the caller cannot read, so it is refused (HTTP 403). Do not run SQL over that Plot again as this caller. Other SQL over it gets the same refusal. Someone whom no Provider Policy or source permissions narrow on those tables can read it.QL-SQ-010: The query would send more paid AI calls (ponder, embed and the Jev functions) than one query may send, so it stopped before the next call (HTTP 400). The message names the limit and the function. Filter, sample or LIMIT the rows before the AI function, or aggregate fewer rows. To call it over every row, publish the SQL as a Plot.QL-SQ-011: The query’s paid AI calls would cost more than one query may spend, so it stopped before the next call (HTTP 400). The message names the limit and what the query spent. Call the AI function over fewer rows or with a cheaper model. To call it over every row, publish the SQL as a Plot.HTTP 404: The requested Parable ref or published pin is not available in this Workspace. Check the ref or commit ID and Workspace context.HTTP 409: The Plot definition or access changed while the query was being prepared. With PA-AU-028, the commitId names a change that has not been published, so there is no Version to run SQL in. Refresh the Plot context and retry, or use a published Version’s commitId.
Authorizations
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
Workspace slug. Overrides subdomain-based workspace resolution when provided.
"acme"
Optional request correlation ID echoed back in the response.
"550e8400-e29b-41d4-a716-446655440000"
Body
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.
Single SQL statement. Text.Sql rejects empty; maxLength is 100000 bytes.
1 - 100000^[\s\S]*$UUID v4 with automatic base62 encoding for client-facing APIs
^([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})$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.
1 <= x <= 9007199254740991Jev defaults for this query only. SQL model arguments override the default. The null policy applies to recoverable input, provider and response failures.
- Option 1
- Option 2
Show child attributes
Show child attributes
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
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.
- Option 1
- Option 2
Show child attributes
Show child attributes
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.
^([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, streamed as application/vnd.apache.arrow.stream
The response is of type file.