import json
import os
from parable_types_web_api import RunArtifactSchemaInferenceInput
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 = RunArtifactSchemaInferenceInput.model_validate(
json.loads("{\"artifactId\":\"550e8400-e29b-41d4-a716-446655440000\"}"),
)
result = sdk.artifacts.run_artifact_schema_inference(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.RunArtifactSchemaInferenceInput
if err := json.Unmarshal([]byte(`{"artifactId":"550e8400-e29b-41d4-a716-446655440000"}`), &input); err != nil {
return err
}
result, err := sdk.ArtifactsNamespace.RunArtifactSchemaInference(ctx, input){
"data": {
"artifact": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"fileName": "<string>",
"fileSize": 4503599627370495,
"fileType": "csv",
"id": "<string>",
"schemaInferenceStatus": "not_requested",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"uploadStatus": "pending",
"uploadedBy": {
"email": "jsmith@example.com",
"id": "<string>",
"name": "<string>"
},
"analysisWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"attributedTapId": "<string>",
"dataSchema": {},
"path": "<string>",
"publishWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
}
},
"sampleRows": [
{}
],
"inference": {
"columnMetadata": [
{
"confidence": "low",
"demoted": true,
"fieldPath": "<string>",
"sampleFailures": 0,
"sampleSeen": 0,
"firstSampleError": "<string>"
}
],
"model": "<string>",
"schema": {},
"tokenInputCount": 0,
"tokenOutputCount": 0,
"processor": "VERTEX"
},
"inferenceError": {
"code": "WA-AF-001",
"message": "<string>"
},
"inferenceRefusal": "ENVIRONMENT_POLICY_MISSING"
},
"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>"
}Gateway TimeoutWork out an Artifact's schema
Uses the verified file sample to infer and save a data schema under the Workspace model policy.
import json
import os
from parable_types_web_api import RunArtifactSchemaInferenceInput
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 = RunArtifactSchemaInferenceInput.model_validate(
json.loads("{\"artifactId\":\"550e8400-e29b-41d4-a716-446655440000\"}"),
)
result = sdk.artifacts.run_artifact_schema_inference(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.RunArtifactSchemaInferenceInput
if err := json.Unmarshal([]byte(`{"artifactId":"550e8400-e29b-41d4-a716-446655440000"}`), &input); err != nil {
return err
}
result, err := sdk.ArtifactsNamespace.RunArtifactSchemaInference(ctx, input){
"data": {
"artifact": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"fileName": "<string>",
"fileSize": 4503599627370495,
"fileType": "csv",
"id": "<string>",
"schemaInferenceStatus": "not_requested",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"uploadStatus": "pending",
"uploadedBy": {
"email": "jsmith@example.com",
"id": "<string>",
"name": "<string>"
},
"analysisWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"attributedTapId": "<string>",
"dataSchema": {},
"path": "<string>",
"publishWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
}
},
"sampleRows": [
{}
],
"inference": {
"columnMetadata": [
{
"confidence": "low",
"demoted": true,
"fieldPath": "<string>",
"sampleFailures": 0,
"sampleSeen": 0,
"firstSampleError": "<string>"
}
],
"model": "<string>",
"schema": {},
"tokenInputCount": 0,
"tokenOutputCount": 0,
"processor": "VERTEX"
},
"inferenceError": {
"code": "WA-AF-001",
"message": "<string>"
},
"inferenceRefusal": "ENVIRONMENT_POLICY_MISSING"
},
"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>"
}Gateway TimeoutAccess
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.artifacts.upload.
Errors
WA-AF-015: The Artifact was not found in this Workspace. Check the artifact identifier and Workspace context.WA-AF-003: Schema inference supports CSV Artifacts only. Upload or select a CSV Artifact.WA-AF-017: The Artifact upload is not ready for schema inference. Wait for the upload to finish, then retry.
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
Input for running (or re-running) schema inference on an existing artifact.
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})$Response
Successful response
Shared result shape for uploadArtifact and runArtifactSchemaInference.
Carries the persisted artifact record alongside optional inference output
and a small sample-row preview so the schema editor can render without an
extra round trip.
Inference fields are populated only by runArtifactSchemaInference. In
uploadArtifact responses, inference, inferenceError and
inferenceRefusal are always null (upload never runs inference).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes