Skip to main content
The Workspace API runs read-only SQL with JSON in and JSON out. You do not need a Flight SQL client. These operations suit scripts, serverless functions, and AI agents that read Provider data. Each result fits in a fixed size, so a script or a model can read every response whole. The one exception is the description of a wide table: ask for its fields a page at a time (see Describe the table). The API Reference has the full request and response of each operation.

Before you start

Send the two headers that every Workspace API request sends (see Authentication):
  • Authorization: Bearer <token>, with a Parable token or an MCP token. These operations only read, so an MCP token works. The API refuses a SQL token.
  • X-Tenant: <workspace-slug>.
An MCP token works only while the Workspace allows external agents. People who manage sign-in turn on Allow external agents in Protection → Access Tokens. While it is off, the API refuses every MCP token with 403 and WA-PAT-006. The token’s owner needs a role with one of these permissions: The examples on this page use three variables. Set PARABLE_API_TOKEN to a Parable token or an MCP token, not to a SQL token:

What these operations read

These operations always read the Provider Pools: providers, providers_quarantine, and providers_quality. When the person’s role already grants Data Access, search, plan, and query also read exactly four Workspace diagnostics: workspace.providers, workspace.provider_connections, workspace.stream_data, and workspace.provider_refusals. Provider Pools Reader gets no Workspace table. A statement that names another table, such as workspace.users, fails with 400 and FROM or JOIN names a source this Workspace cannot read. Choose an available source, or ask a Workspace Administrator to check your data access. (QL-PL-002). To read the the artifacts or parables pools, or another Workspace table, use Flight SQL, or Arrow over HTTP with a Parable token. Provider Policies and source permissions narrow the rows of every statement for every person, holders of All data access included. A script that runs with a Workspace Administrator’s token reads only what the Policies give that administrator’s roles. To read every row as a holder of All data access, use Flight SQL with a SQL token. Rows you can read explains both.

Walk through a query

1. Find the table

Describe the data in plain words. scope narrows the search to a pool, a Provider, or a table, with the same patterns as search_available_data:
Response (shortened)
Use tableRef in FROM and columnName in SELECT. score ranks the results of one search. Compare it only within that search. matchedBy says whether the words (keyword), the meaning (semantic), or both matched. A search ranks at most 500 results. Page through them with offset. To list tables instead of searching, send an empty query or *. With no scope, the listing returns each Provider and its table count in providers. With a scope such as providers.google, it returns that Provider’s tables. A listing page holds up to 100 tables or 40,000 characters. When there are more, send nextCursor back as cursor.

2. Describe the table

Response (shortened)
tableRef is the exact name pool.schema.table. A name that the catalog does not list returns 404 with Pool table not found. A field with no Parable scalar has no scalarRef. system: true marks a column that Parable adds, such as the state columns. Other fields are not shown. They are the same as in the catalog. A wide table can have hundreds of fields, and its description can be more than 50,000 characters. To read the fields a page at a time, send fieldLimit (1 to 1,000), fieldOffset, or both:
  • A page holds at most fieldLimit fields, in catalog order. With only fieldOffset, the limit is 1,000.
  • A page stops before 40,000 characters, but it always holds one field.
  • table.validationRates holds the rates of the page’s fields. A rate that is not a field’s, such as _parable_row_valid for whole rows, is on every page. So are the key, relationships, and statistics.
  • Send nextFieldOffset back as fieldOffset for the next page. The last page has no nextFieldOffset.
A request with neither fieldLimit nor fieldOffset gets every field at once.

3. Plan the query

plan checks a statement against the catalog and your access, and returns the columns that it would return. It runs nothing and reads no rows:
Response (shortened)
When Parable refuses a statement for a reason that you can correct, plan still answers 200. planned is false, and refusal has the error code and a message that says what to change:

4. Run the query

query takes the same body as plan:
Response (shortened)
Each row is a JSON array in the order of columns. arrowType says how to read a value that arrives as text, such as a timestamp. Some values change form so that JSON carries them exactly:
  • A 64-bit integer outside ±(253 − 1), and every decimal, is a string.
  • Binary data is base64 text.
  • NaN and infinities are strings.

Bind parameters

Write $1, $2, and so on in the SQL, and send the values in parameters in the same order. Each value is a JSON string, number, boolean, or null. Bind every value that comes from a person or a program. Do not build it into the SQL text.

See how Parable runs a statement

Send EXPLAIN followed by a query to query. It returns two rows, logical_plan and physical_plan, in the columns plan_type and plan, and runs nothing. The plan explains what the plan shows.

Results that are cut

A result is never larger than these limits. When a result reaches one, Parable cuts it and says so. It never changes a value without saying so. warnings says the same in plain sentences. A LIMIT in your SQL is the best way to keep the whole result.

Limits

Errors

Errors use the Problem Details format with a code, as described in the API Reference.

Read the query guidance

GET /api/provider-pool/guidance returns the guidance that Parable’s own agents read before they write SQL for these tables: how to find tables, read Provider data, and write Plots. Each text has a name, a title, a description, and Markdown content. version changes when the text changes. The guidance is the same in every Workspace. Give it to your own agent as context.

Check a query before you run it

POST /api/parables/immediate-plot-query/actions/estimate is a dry run. It plans a statement exactly as running it would, and runs nothing. It tells you how much data the statement reads, what that costs, and how many paid AI calls it can make. The owner needs tenant.view or tenant.data.query.providers. With a Parable token, the statement can read every pool that the owner’s role can query, as over Flight SQL. With an MCP token, it reads the Provider Pools alone. The counts include rows that Policies hide, so an MCP token gets 403 with PA-AU-019 when its statement names a Parable, or when a Provider Policy or source permissions narrow what the token reads. All data access does not count here.
Response (shortened)
The dry run refuses what running the statement would refuse, with the same codes. It never refuses a statement for its size.

Arrow over HTTP, for every pool

POST /api/parables/immediate-plot-query runs one statement and returns its rows as an Arrow IPC stream (application/vnd.apache.arrow.stream). It takes the same body as the dry run. Use it when you need Arrow, or a pool other than the Provider Pools, without a Flight SQL client.
  • With a Parable token, it reads every pool that the owner’s role can query, under the same rules as Flight SQL. All data access applies.
  • With an MCP token, it reads the Provider Pools that the owner’s role can query, and in a Parable only that Parable’s Plots. All data access does not apply. It refuses a SQL token.
  • It stops a query after 120 seconds, and an MCP token’s query after 30 seconds. The Parable SDKs wait 30 seconds by default, so set a longer timeout in the client for a slow query.
  • Write a LIMIT: it caps no rows itself.
  • The body is complete only when it ends with the Arrow end-of-stream marker. A body that ends without it failed. A refusal is a Problem Details error with the same codes as on this page.
Read the file with any Arrow IPC stream reader, such as pyarrow.ipc.open_stream.