import json
import os
from parable_types_web_api import PreviewSourcePermissionsInput
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 = PreviewSourcePermissionsInput.model_validate(
json.loads("{\"email\":\"person@example.com\"}"),
)
result = sdk.provider_policies.preview_source_permissions(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.PreviewSourcePermissionsInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com"}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.PreviewSourcePermissions(ctx, input){
"data": {
"person": {
"email": "jsmith@example.com",
"userId": "<string>"
},
"tables": [
{
"outcome": "counted",
"providerKey": "<string>",
"readable": 4503599627370495,
"tableKey": "<string>",
"total": 4503599627370495
}
]
},
"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>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Preview what one person reads under source permissions
For the active member who signs in with the given email, counts the rows of each table source permissions model and the rows that member can open in the Provider, as a read under source permissions would decide them with the Workspace’s link-only setting. It returns numbers, never rows. A table whose read under source permissions would be refused says so. Counts are withheld on a table the person asking does not read in full with their own SQL. Provider Policies are not applied. Each preview is recorded in the audit trail with the member it is about.
import json
import os
from parable_types_web_api import PreviewSourcePermissionsInput
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 = PreviewSourcePermissionsInput.model_validate(
json.loads("{\"email\":\"person@example.com\"}"),
)
result = sdk.provider_policies.preview_source_permissions(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.PreviewSourcePermissionsInput
if err := json.Unmarshal([]byte(`{"email":"person@example.com"}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.PreviewSourcePermissions(ctx, input){
"data": {
"person": {
"email": "jsmith@example.com",
"userId": "<string>"
},
"tables": [
{
"outcome": "counted",
"providerKey": "<string>",
"readable": 4503599627370495,
"tableKey": "<string>",
"total": 4503599627370495
}
]
},
"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>"
}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.providerpolicies.view, tenant.providerpolicies.manage.
Errors
WA-PP-007: Parable could not read the access projection or count the tables. Try again.WA-PP-011: No active member of the Workspace signs in with this email. Enter the email that a member of this Workspace signs in with.
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
Asks what one person would read from each table source permissions model.
The email the person signs in with.
255^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$Response
Successful response