import json
import os
from parable_types_web_api import PreviewProviderPolicyInput
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 = PreviewProviderPolicyInput.model_validate(
json.loads("{\"definition\":{\"rules\":[],\"everyoneElse\":{\"access\":\"all_rows\",\"conditions\":[]}},\"count\":true}"),
)
result = sdk.provider_policies.preview_provider_policy('example', 'example', 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.PreviewProviderPolicyInput
if err := json.Unmarshal([]byte(`{"definition":{"rules":[],"everyoneElse":{"access":"all_rows","conditions":[]}},"count":true}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.PreviewProviderPolicy(ctx, "example", "example", input){
"data": {
"columns": [
"<string>"
],
"modeled": true,
"problems": [
{
"condition": 4503599627370495,
"message": "<string>",
"ruleKey": "<string>"
}
],
"readsReader": true,
"served": true,
"counts": {
"audiences": [
{
"readsReader": true,
"rows": 4503599627370495,
"ruleKey": "<string>"
}
],
"total": 0
},
"logicalName": "<string>",
"schemaName": "<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>"
}Check a Provider Policy before saving it
Compiles each condition of a proposed Provider Policy against the table’s columns, as saving it would, and returns every problem, the columns the conditions name, whether they read who is reading, and whether the table takes Source permissions. With count, it also counts the rows each rule and Everyone else would read, in one pass over the table, and returns numbers, never rows. A rule that reads Source permissions, or whose conditions read who is reading, is not counted. It stores nothing.
import json
import os
from parable_types_web_api import PreviewProviderPolicyInput
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 = PreviewProviderPolicyInput.model_validate(
json.loads("{\"definition\":{\"rules\":[],\"everyoneElse\":{\"access\":\"all_rows\",\"conditions\":[]}},\"count\":true}"),
)
result = sdk.provider_policies.preview_provider_policy('example', 'example', 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.PreviewProviderPolicyInput
if err := json.Unmarshal([]byte(`{"definition":{"rules":[],"everyoneElse":{"access":"all_rows","conditions":[]}},"count":true}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.PreviewProviderPolicy(ctx, "example", "example", input){
"data": {
"columns": [
"<string>"
],
"modeled": true,
"problems": [
{
"condition": 4503599627370495,
"message": "<string>",
"ruleKey": "<string>"
}
],
"readsReader": true,
"served": true,
"counts": {
"audiences": [
{
"readsReader": true,
"rows": 4503599627370495,
"ruleKey": "<string>"
}
],
"total": 0
},
"logicalName": "<string>",
"schemaName": "<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>"
}Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.providerpolicies.manage.
Errors
WA-PP-006: The Policy is over a size limit or has a malformed rule. Keep a table to 50 rules, 100 conditions and 60 KiB of condition text.WA-PP-007: Parable could not check the conditions. Try again.WA-PP-008: A count reads the table past every Provider Policy, and your own Policies narrow it or your roles do not read it with SQL. Check the Policy without counting, or ask someone who reads every row of the table to count it.WA-PP-010: A rule reads Source permissions on a table whose Provider does not say who can open each row. Choose All rows, Rows where or Hidden for this table.
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"
Path Parameters
providerKey parameter UUID v4 with automatic base62 encoding for client-facing APIs
tableKey parameter UUID v4 with automatic base62 encoding for client-facing APIs
Body
A proposed Provider Policy for one table, checked and not saved.
Also count the rows each rule and Everyone else would read. Counting reads the table once; checking alone reads no row.
A Provider Policy: which rows of one Provider table the people in each role
read, in every read of the Workspace. A reader gets the union
of every rule that names one of their roles; a reader no rule names gets
everyoneElse. Parable also checks whole-table limits: a role in at most
one rule, and at most 100 conditions and 60 KiB of condition text per table.
Show child attributes
Show child attributes