Python SDK
import json
import os
from parable_types_web_api import CreateParableArtifactInput
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 = CreateParableArtifactInput.model_validate(
json.loads("{\"fileName\":\"example\",\"text\":\"example\",\"idempotencyKey\":\"example\"}"),
)
result = sdk.parable_artifacts.create_parable_artifact('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.CreateParableArtifactInput
if err := json.Unmarshal([]byte(`{"fileName":"example","text":"example","idempotencyKey":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParableArtifactsNamespace.CreateParableArtifact(ctx, "example", input){
"data": {
"notice": "<string>",
"status": "ready",
"artifact": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"fileName": "<string>",
"fileSize": 4503599627370495,
"fileType": "csv",
"id": "<string>",
"kind": "image",
"madeByPonder": true,
"schemaInferenceStatus": "not_requested",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"uploadStatus": "pending",
"analysisWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"attributedTapId": "<string>",
"dataSchema": {},
"deletedAt": "2023-11-07T05:31:56Z",
"familyName": "<string>",
"media": {
"design": {
"hasThumbnail": true
},
"font": {
"axes": [
{
"default": 123,
"max": 123,
"min": 123,
"tag": "<string>"
}
],
"family": "<string>",
"instances": [
{
"coordinates": [
{
"tag": "<string>",
"value": 123
}
],
"name": "<string>"
}
],
"italic": true,
"revision": 123,
"subfamily": "<string>",
"weight": 0,
"width": 0,
"fullName": "<string>",
"postscriptName": "<string>",
"sampleText": "<string>"
},
"image": {
"animated": true,
"height": 0,
"width": 0
},
"video": {
"codec": "<string>",
"durationMs": 0,
"height": 0,
"width": 0
}
},
"parableId": "<string>",
"path": "<string>",
"publishWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"rowCount": 0,
"tableAddress": "<string>",
"tableSchema": {},
"uploadExpiresAt": "2023-11-07T05:31:56Z",
"uploadedBy": {
"email": "jsmith@example.com",
"id": "<string>",
"name": "<string>"
}
},
"image": {
"data": "<string>",
"fileName": "<string>",
"mediaType": "<string>"
},
"markup": "<string>",
"omitted": "<string>",
"recovery": "<string>",
"sample": {
"rows": [
{}
],
"schema": {},
"truncated": true,
"inference": {
"columnMetadata": [
{
"confidence": "low",
"demoted": true,
"fieldPath": "<string>",
"sampleFailures": 0,
"sampleSeen": 0,
"firstSampleError": "<string>"
}
],
"model": "<string>",
"schema": {},
"tokenInputCount": 0,
"tokenOutputCount": 0,
"processor": "VERTEX"
}
},
"sampleRowCount": 0
},
"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>"
}{
"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>"
}Create a Parable Artifact
Stores one text file in a Parable’s Artifacts: SVG, CSV or JSON Lines text. It uses the same name rule, allowlist, size setting and worker check as a person’s upload, and adds a file only where the caller could. The same idempotencyKey with the same name and text stores one file. The hosted MCP endpoint takes a request of at most 1 MiB, JSON included, so a file over MCP must be smaller. Pass the rootRefId of the Parable.
POST
/
api
/
parable
/
authoring
/
primaries
/
{rootRefId}
/
artifacts
/
actions
/
create
Python SDK
import json
import os
from parable_types_web_api import CreateParableArtifactInput
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 = CreateParableArtifactInput.model_validate(
json.loads("{\"fileName\":\"example\",\"text\":\"example\",\"idempotencyKey\":\"example\"}"),
)
result = sdk.parable_artifacts.create_parable_artifact('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.CreateParableArtifactInput
if err := json.Unmarshal([]byte(`{"fileName":"example","text":"example","idempotencyKey":"example"}`), &input); err != nil {
return err
}
result, err := sdk.ParableArtifactsNamespace.CreateParableArtifact(ctx, "example", input){
"data": {
"notice": "<string>",
"status": "ready",
"artifact": {
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"fileName": "<string>",
"fileSize": 4503599627370495,
"fileType": "csv",
"id": "<string>",
"kind": "image",
"madeByPonder": true,
"schemaInferenceStatus": "not_requested",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"uploadStatus": "pending",
"analysisWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"attributedTapId": "<string>",
"dataSchema": {},
"deletedAt": "2023-11-07T05:31:56Z",
"familyName": "<string>",
"media": {
"design": {
"hasThumbnail": true
},
"font": {
"axes": [
{
"default": 123,
"max": 123,
"min": 123,
"tag": "<string>"
}
],
"family": "<string>",
"instances": [
{
"coordinates": [
{
"tag": "<string>",
"value": 123
}
],
"name": "<string>"
}
],
"italic": true,
"revision": 123,
"subfamily": "<string>",
"weight": 0,
"width": 0,
"fullName": "<string>",
"postscriptName": "<string>",
"sampleText": "<string>"
},
"image": {
"animated": true,
"height": 0,
"width": 0
},
"video": {
"codec": "<string>",
"durationMs": 0,
"height": 0,
"width": 0
}
},
"parableId": "<string>",
"path": "<string>",
"publishWork": {
"artifactId": "<string>",
"state": "PENDING",
"workId": "<string>",
"errorCode": "INVALID_SOURCE",
"errorMessage": "<string>",
"tapId": "<string>"
},
"rowCount": 0,
"tableAddress": "<string>",
"tableSchema": {},
"uploadExpiresAt": "2023-11-07T05:31:56Z",
"uploadedBy": {
"email": "jsmith@example.com",
"id": "<string>",
"name": "<string>"
}
},
"image": {
"data": "<string>",
"fileName": "<string>",
"mediaType": "<string>"
},
"markup": "<string>",
"omitted": "<string>",
"recovery": "<string>",
"sample": {
"rows": [
{}
],
"schema": {},
"truncated": true,
"inference": {
"columnMetadata": [
{
"confidence": "low",
"demoted": true,
"fieldPath": "<string>",
"sampleFailures": 0,
"sampleSeen": 0,
"firstSampleError": "<string>"
}
],
"model": "<string>",
"schema": {},
"tokenInputCount": 0,
"tokenOutputCount": 0,
"processor": "VERTEX"
}
},
"sampleRowCount": 0
},
"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>"
}{
"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>"
}Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.parables.manage.
Errors
WA-AF-020: The file name is empty after cleaning, or longer than 255 bytes. Use a shorter name with its extension, such as logo.svg.WA-AF-003: This operation stores SVG, CSV and JSON Lines text only. Use a file name that ends in .svg, .csv or .jsonl.WA-AF-021: The file is larger than the Workspace file size setting. Store a smaller file.WA-AF-024: The Parable already keeps as many files as its limit allows. Ask Parable staff to raise the limit.PA-AU-001: The Parable is not visible to the caller. Check the rootRefId, or ask for a seat on the Parable.PA-AU-007: The Parable is Pocketed, so its files are read-only. Restore the Parable. Then call again.HTTP 403: The caller can view this Parable but cannot change its files. Ask a person with Primary or Publishing to add the file.HTTP 409: Another person or another Parable used this idempotencyKey, or a call that stopped holds a reservation that expired. Send a new idempotencyKey.HTTP 503: The file could not be stored. Nothing was checked. Call again with the same idempotencyKey. In Ponder, tell the person, who can ask for it again in a new Message.
Authorizations
Headers
Path Parameters
Body
application/json
A text file that an agent wrote. It goes through the same name rule, allowlist, size setting and worker check as a person's upload.
The file's whole text.
Minimum string length:
1Response
Successful response