import json
import os
from parable_types_web_api import AddConnectorToTenantInput
from parable_web_api_sdk import ClientConfig, PublicEncryptionKey, 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"]},
)
)
key = sdk.security.encryption_key()
sdk.set_public_encryption_key(
PublicEncryptionKey(public_key=key.public_key, algorithm=key.algorithm, key_id=key.key_id)
)
input_data = AddConnectorToTenantInput.model_validate(
json.loads("{\"connectorId\":\"550e8400-e29b-41d4-a716-446655440000\",\"groupingId\":\"550e8400-e29b-41d4-a716-446655440000\",\"authenticationStrategyId\":\"550e8400-e29b-41d4-a716-446655440000\",\"authenticationConfig\":{},\"ingestionConfig\":{}}"),
)
result = sdk.connectors.add_connector_to_tenant(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
}
key, err := sdk.SecurityNamespace.EncryptionKey(ctx)
if err != nil {
return err
}
sdk.SetPublicEncryptionKey(&webapisdk.PublicEncryptionKey{
PublicKey: string(key.PublicKey),
Algorithm: string(key.Algorithm),
KeyID: key.KeyId,
})
var input webapitypes.AddConnectorToTenantInput
if err := json.Unmarshal([]byte(`{"connectorId":"550e8400-e29b-41d4-a716-446655440000","groupingId":"550e8400-e29b-41d4-a716-446655440000","authenticationStrategyId":"550e8400-e29b-41d4-a716-446655440000","authenticationConfig":{},"ingestionConfig":{}}`), &input); err != nil {
return err
}
result, err := sdk.ConnectorsNamespace.AddConnectorToTenant(ctx, input, nil){
"data": {
"authenticationConfig": {},
"authenticationStrategy": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"type": "bearer",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"addressingConfig": {
"basePath": "<string>",
"host": "<string>",
"scheme": "<string>",
"variables": [
{
"name": "<string>",
"source": "<string>",
"oauthResponsePath": "<string>",
"required": true
}
]
},
"apiKeyConfig": {
"credentialHeaders": {},
"headerName": "<string>",
"queryParam": "<string>"
},
"basicConfig": {
"passwordField": "<string>",
"usernameField": "<string>",
"passwordValue": "<string>"
},
"bearerConfig": {
"headerName": "<string>",
"tokenField": "<string>",
"tokenPrefix": "<string>"
},
"configSchema": {},
"credentialProbe": {
"operations": [
{
"id": "<string>",
"outcomes": [
{
"all": [
{
"operator": "equals",
"source": {
"namespace": "credential",
"path": "<string>"
},
"expected": "<unknown>"
}
],
"outcome": "success",
"reason": "<string>"
}
],
"request": {
"allowedHostSuffixes": [
"<string>"
],
"auth": {
"mode": "none",
"password": "<string>",
"username": "<string>"
},
"endpoint": "<string>",
"method": "GET",
"allowedConfiguredHost": "<string>",
"defaults": {},
"fallbackEndpoint": "<string>",
"headers": {},
"queryParams": {},
"replaySafe": true,
"requestBody": "<unknown>"
},
"extracts": [
{
"name": "<string>",
"source": {
"namespace": "credential",
"path": "<string>"
},
"type": "string",
"secret": true
}
],
"invocation": {
"forEach": {
"namespace": "credential",
"path": "<string>"
},
"itemName": "<string>",
"aggregation": "all_success",
"maxItems": 0
}
}
],
"maxRequests": 0,
"signedTokens": [
{
"algorithm": "HS256",
"claims": "<unknown>",
"key": "<string>",
"lifetimeSeconds": 0,
"name": "<string>",
"headers": {}
}
],
"timeoutSeconds": 0,
"writebacks": [
{
"extract": "<string>",
"operation": "<string>",
"target": "<string>"
}
]
},
"defaultBaseUrl": "<string>",
"defaultScopes": [
"<string>"
],
"delegatedUserField": "<string>",
"docs": "<string>",
"extraHeaders": {},
"hook": "<string>",
"ingestionConfigSchema": {},
"label": "<string>",
"oauth2Config": {
"tokenEndpoint": "<string>",
"audienceParam": "<string>",
"authorizeUrl": "<string>",
"grantType": "client_credentials",
"passwordField": "<string>",
"platformManagedClient": true,
"resourceHeaders": {},
"scopes": [
"<string>"
],
"tokenBodyEncoding": "json",
"tokenEndpointAuthMethod": "client_secret_basic",
"tokenEndpointExtraParams": "<unknown>",
"tokenPrefix": "<string>",
"tokenReadinessDelaySeconds": 5,
"tokenRefreshCodes": [
499
],
"tokenResponsePath": "<string>",
"usernameField": "<string>"
},
"preEncodedBasicConfig": {
"tokenField": "<string>"
},
"support": "supported"
},
"createdAt": "2023-11-07T05:31:56Z",
"credentialMetadataId": "<string>",
"id": "<string>",
"ingestionConfig": {},
"message": "<string>",
"success": true,
"tenant": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"logo": {}
},
"name": "<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>"
}Connect a Provider
Adds a Provider connection to this Workspace and applies the settings it needs to start working.
import json
import os
from parable_types_web_api import AddConnectorToTenantInput
from parable_web_api_sdk import ClientConfig, PublicEncryptionKey, 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"]},
)
)
key = sdk.security.encryption_key()
sdk.set_public_encryption_key(
PublicEncryptionKey(public_key=key.public_key, algorithm=key.algorithm, key_id=key.key_id)
)
input_data = AddConnectorToTenantInput.model_validate(
json.loads("{\"connectorId\":\"550e8400-e29b-41d4-a716-446655440000\",\"groupingId\":\"550e8400-e29b-41d4-a716-446655440000\",\"authenticationStrategyId\":\"550e8400-e29b-41d4-a716-446655440000\",\"authenticationConfig\":{},\"ingestionConfig\":{}}"),
)
result = sdk.connectors.add_connector_to_tenant(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
}
key, err := sdk.SecurityNamespace.EncryptionKey(ctx)
if err != nil {
return err
}
sdk.SetPublicEncryptionKey(&webapisdk.PublicEncryptionKey{
PublicKey: string(key.PublicKey),
Algorithm: string(key.Algorithm),
KeyID: key.KeyId,
})
var input webapitypes.AddConnectorToTenantInput
if err := json.Unmarshal([]byte(`{"connectorId":"550e8400-e29b-41d4-a716-446655440000","groupingId":"550e8400-e29b-41d4-a716-446655440000","authenticationStrategyId":"550e8400-e29b-41d4-a716-446655440000","authenticationConfig":{},"ingestionConfig":{}}`), &input); err != nil {
return err
}
result, err := sdk.ConnectorsNamespace.AddConnectorToTenant(ctx, input, nil){
"data": {
"authenticationConfig": {},
"authenticationStrategy": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"type": "bearer",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"addressingConfig": {
"basePath": "<string>",
"host": "<string>",
"scheme": "<string>",
"variables": [
{
"name": "<string>",
"source": "<string>",
"oauthResponsePath": "<string>",
"required": true
}
]
},
"apiKeyConfig": {
"credentialHeaders": {},
"headerName": "<string>",
"queryParam": "<string>"
},
"basicConfig": {
"passwordField": "<string>",
"usernameField": "<string>",
"passwordValue": "<string>"
},
"bearerConfig": {
"headerName": "<string>",
"tokenField": "<string>",
"tokenPrefix": "<string>"
},
"configSchema": {},
"credentialProbe": {
"operations": [
{
"id": "<string>",
"outcomes": [
{
"all": [
{
"operator": "equals",
"source": {
"namespace": "credential",
"path": "<string>"
},
"expected": "<unknown>"
}
],
"outcome": "success",
"reason": "<string>"
}
],
"request": {
"allowedHostSuffixes": [
"<string>"
],
"auth": {
"mode": "none",
"password": "<string>",
"username": "<string>"
},
"endpoint": "<string>",
"method": "GET",
"allowedConfiguredHost": "<string>",
"defaults": {},
"fallbackEndpoint": "<string>",
"headers": {},
"queryParams": {},
"replaySafe": true,
"requestBody": "<unknown>"
},
"extracts": [
{
"name": "<string>",
"source": {
"namespace": "credential",
"path": "<string>"
},
"type": "string",
"secret": true
}
],
"invocation": {
"forEach": {
"namespace": "credential",
"path": "<string>"
},
"itemName": "<string>",
"aggregation": "all_success",
"maxItems": 0
}
}
],
"maxRequests": 0,
"signedTokens": [
{
"algorithm": "HS256",
"claims": "<unknown>",
"key": "<string>",
"lifetimeSeconds": 0,
"name": "<string>",
"headers": {}
}
],
"timeoutSeconds": 0,
"writebacks": [
{
"extract": "<string>",
"operation": "<string>",
"target": "<string>"
}
]
},
"defaultBaseUrl": "<string>",
"defaultScopes": [
"<string>"
],
"delegatedUserField": "<string>",
"docs": "<string>",
"extraHeaders": {},
"hook": "<string>",
"ingestionConfigSchema": {},
"label": "<string>",
"oauth2Config": {
"tokenEndpoint": "<string>",
"audienceParam": "<string>",
"authorizeUrl": "<string>",
"grantType": "client_credentials",
"passwordField": "<string>",
"platformManagedClient": true,
"resourceHeaders": {},
"scopes": [
"<string>"
],
"tokenBodyEncoding": "json",
"tokenEndpointAuthMethod": "client_secret_basic",
"tokenEndpointExtraParams": "<unknown>",
"tokenPrefix": "<string>",
"tokenReadinessDelaySeconds": 5,
"tokenRefreshCodes": [
499
],
"tokenResponsePath": "<string>",
"usernameField": "<string>"
},
"preEncodedBasicConfig": {
"tokenField": "<string>"
},
"support": "supported"
},
"createdAt": "2023-11-07T05:31:56Z",
"credentialMetadataId": "<string>",
"id": "<string>",
"ingestionConfig": {},
"message": "<string>",
"success": true,
"tenant": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"logo": {}
},
"name": "<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>"
}400. See Encrypted request bodies.Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.connectors.create.
Errors
WA-TN-001: No Workspace context was supplied. Call from a Workspace context.WA-CN-002: The selected authentication strategy was not found for this Provider. Choose an available Provider authentication strategy.WA-CN-005: The Provider is not released for Workspace enablement. Choose a released Provider or ask an administrator to promote it.
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
A Parable Schema in JSON
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})$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})$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})$A Parable Schema in JSON
An objects name
2 - 80