import json
import os
from parable_types_web_api import ProviderPoolQueryInput
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 = ProviderPoolQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.provider_pool.query_provider_pool(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.ProviderPoolQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoolNamespace.QueryProviderPool(ctx, input){
"data": {
"columns": [
{
"arrowType": "<string>",
"name": "<string>",
"scalarRef": "<string>"
}
],
"elapsedMs": 0,
"requestId": "<string>",
"returnedRows": 0,
"rows": [
"<unknown>"
],
"truncated": {
"capture": true,
"rows": true,
"values": true
},
"warnings": [
"<string>"
],
"catalogVersion": "<string>"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<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>"
}Gateway TimeoutQuery the Provider Pool
Runs one SQL statement over the Provider Pools (providers, providers_quarantine, providers_quality) and returns a view a model can read. 1. sql is one read-only statement. 2. parameters bind 1,2 in order; identifiers cannot be bound. 3. The view holds whole leading rows within 60,000 characters, columns included, and cuts a text or binary value at 2,000; truncated says which limit applied and warnings say what to change. 4. returnedRows counts the rows shown, never the total. 5. A 64-bit integer past 2^53 and every decimal arrive as text beside their arrowType. 6. A table in another Pool is an unknown relation (QL-PL-002).
import json
import os
from parable_types_web_api import ProviderPoolQueryInput
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 = ProviderPoolQueryInput.model_validate(
json.loads("{\"sql\":\"example\"}"),
)
result = sdk.provider_pool.query_provider_pool(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.ProviderPoolQueryInput
if err := json.Unmarshal([]byte(`{"sql":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoolNamespace.QueryProviderPool(ctx, input){
"data": {
"columns": [
{
"arrowType": "<string>",
"name": "<string>",
"scalarRef": "<string>"
}
],
"elapsedMs": 0,
"requestId": "<string>",
"returnedRows": 0,
"rows": [
"<unknown>"
],
"truncated": {
"capture": true,
"rows": true,
"values": true
},
"warnings": [
"<string>"
],
"catalogVersion": "<string>"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<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>"
}Gateway TimeoutAccess
An MCP token or a Parable token can call this operation. See Authentication for the kinds of token. Your roles must granttenant.data.query.providers.
Errors
HTTP 400: Parable refused the SQL. The message gives the reason, and the code is a QL code, such as QL-PL-002 for a table or function the Provider Pools do not serve. Correct the SQL from the stated reason; describe the table again if a name is unknown. Do not resend the same statement.HTTP 403: The caller may not query data in this Workspace. Ask a Workspace Administrator for the Provider Pools Reader role. A different query does not help.HTTP 504: The statement ran past its time budget (a QL-TO code) or did not finish in 30 seconds. Filter on a partition column, aggregate, or add a LIMIT.HTTP 429: Too many queries were running, so the statement did not start (QL-IN-008), or the caller sent more than 120 of these requests in a minute. Nothing ran. Wait a moment, or for the seconds in the Retry-After header when it is set, then send the same request again.HTTP 503: The statement stopped for lack of memory (QL-IN-009), or a service it needs did not answer, such as the model service behind semantic ranking or a SQL AI function (QL-IN-010). The code says which. Try again shortly. For QL-IN-009, read fewer columns or rows, or aggregate.
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 against the Provider Pools, or to plan without running.
Single read-only SQL statement. Text.Sql rejects empty; maxLength is 100000 bytes.
1 - 100000^[\s\S]*$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). Identifiers and the arguments of search_available_data cannot be bound.
Any valid JSON value: object, array, primitive, or null
Response
Successful response
A SQL result a model can read: typed columns and whole leading rows as JSON. Each row is a JSON array with one value per column, in column order. A value is written by its column's arrowType:
- A 64-bit integer inside the JavaScript safe range, a smaller integer and a finite float are JSON numbers. A 64-bit integer past 2^53 - 1 is text.
- A decimal is text with every digit of its scale, such as
1.50. - A date is
YYYY-MM-DD. A timestamp is ISO 8601 with the fraction its unit holds; one with a time zone is the UTC instant and ends withZ, one without is a wall-clock time and carries no zone. - A time is
HH:MM:SSwith its fraction, a duration ISO 8601 seconds. - Binary is base64. A struct is an object, a list an array, a map an object.
- A null is JSON null. Nothing is rounded.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes