> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parable.work/llms.txt
> Use this file to discover all available pages before exploring further.

# Work out an Artifact's schema

> Uses the verified file sample to infer and save a data schema under the Workspace model policy.

> **[Work out an Artifact's schema](/protocols/_generated/mcp/web-api/artifacts#tool-work_out_artifact_schema)**
>
> `work_out_artifact_schema`


## OpenAPI

````yaml /protocols/_generated/openapi/web-api.json post /api/artifacts/run-artifact-schema-inference
openapi: 3.0.3
info:
  description: >-
    Use the Workspace API to work with artifacts, connectors, Parables, and
    account resources.
  title: Workspace API
  version: v2026.10.22.1
servers: []
security: []
paths:
  /api/artifacts/run-artifact-schema-inference:
    post:
      tags:
        - Artifacts
      summary: Work out an Artifact's schema
      description: >-
        Uses the verified file sample to infer and save a data schema under the
        Workspace model policy.
      operationId: ArtifactsRunArtifactSchemaInferenceHandler
      parameters:
        - description: >-
            Workspace slug. Overrides subdomain-based workspace resolution when
            provided.
          in: header
          name: X-Tenant
          required: false
          schema:
            example: acme
            type: string
        - description: Optional request correlation ID echoed back in the response.
          in: header
          name: X-Request-ID
          required: false
          schema:
            example: 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunArtifactSchemaInferenceInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ArtifactUploadResult'
                  links:
                    $ref: '#/components/schemas/ResponseLinks'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
                required:
                  - data
                  - meta
                type: object
          description: Successful response
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: >-
            The request is not valid. `detail` says why. A value that breaks a
            field rule gives the code `WA-VL-001` and an `errors` member that
            names each field.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: The token is missing, malformed, revoked, or expired.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: >-
            The token cannot make this request. For example, the roles of its
            owner do not allow the operation.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          description: The request failed on the server.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
        '504':
          content:
            text/plain:
              schema:
                example: Gateway Timeout
                type: string
          description: The operation did not finish in 120 seconds.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
      security:
        - bearerAuth: []
      x-codeSamples:
        - label: TypeScript SDK
          lang: typescript
          source: >-
            import { WebApiSDK } from "@parable-platform/web-api-sdk";

            import type { RunArtifactSchemaInferenceInput } from
            "@parable-platform/web-api-types";


            const sdk = new WebApiSDK({
              baseUrl: process.env.PARABLE_API_URL!,
              auth: { token: process.env.PARABLE_API_TOKEN! },
              requestInterceptor: (config) => ({
                ...config,
                headers: { ...config.headers, "X-Tenant": process.env.PARABLE_WORKSPACE! },
              }),
            });


            const input: RunArtifactSchemaInferenceInput = JSON.parse(`{
              "artifactId": "550e8400-e29b-41d4-a716-446655440000"
            }`);

            const result = await sdk.artifacts.runArtifactSchemaInference(
              input
            );
        - label: Python SDK
          lang: python
          source: |-
            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)
        - label: Rust SDK
          lang: rust
          source: >-
            use parable_web_api_sdk::{types, ClientConfig, RequestOptions,
            WebApiSdk};


            let sdk = WebApiSdk::new(ClientConfig::with_base_url(
                std::env::var("PARABLE_API_URL")?,
                Some(std::env::var("PARABLE_API_TOKEN")?),
                None,
            ))?;

            let options = RequestOptions::with_header("X-Tenant",
            std::env::var("PARABLE_WORKSPACE")?, None, None);


            let input: types::RunArtifactSchemaInferenceInput =
            serde_json::from_value(
                serde_json::json!({
              "artifactId": "550e8400-e29b-41d4-a716-446655440000"
            }),

            )?;

            let result = sdk.artifacts.run_artifact_schema_inference(
                input,
                Some(&options)
            ).await?;
        - label: Go SDK
          lang: go
          source: "sdk, err := webapisdk.New(webapisdk.SDKConfig{\n\tBaseURL: os.Getenv(\"PARABLE_API_URL\"),\n\tAuth:    &webapisdk.AuthConfig{Token: os.Getenv(\"PARABLE_API_TOKEN\")},\n\tRequestInterceptor: func(ctx context.Context, req *http.Request) error {\n\t\treq.Header.Set(\"X-Tenant\", os.Getenv(\"PARABLE_WORKSPACE\"))\n\t\treturn nil\n\t},\n})\nif err != nil {\n\treturn err\n}\n\nvar input webapitypes.RunArtifactSchemaInferenceInput\nif err := json.Unmarshal([]byte(`{\"artifactId\":\"550e8400-e29b-41d4-a716-446655440000\"}`), &input); err != nil {\n\treturn err\n}\nresult, err := sdk.ArtifactsNamespace.RunArtifactSchemaInference(ctx, input)"
components:
  schemas:
    RunArtifactSchemaInferenceInput:
      description: >-
        Input for running (or re-running) schema inference on an existing
        artifact.
      properties:
        artifactId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          pattern: >-
            ^([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})$
          type: string
      required:
        - artifactId
      type: object
    ArtifactUploadResult:
      description: >-
        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).
      properties:
        artifact:
          $ref: '#/components/schemas/ArtifactInfo'
          description: The persisted artifact record.
        inference:
          description: |-
            Schema inference output. Always null in `uploadArtifact` responses
            (upload does not run inference). Populated by
            `runArtifactSchemaInference` on success; null on that call when
            inference failed -- in which case `inferenceError` is populated.
          oneOf:
            - $ref: '#/components/schemas/ArtifactInference'
            - enum:
                - null
              nullable: true
              type: object
        inferenceError:
          description: >-
            Populated only by `runArtifactSchemaInference` when inference
            failed.

            The artifact remains available with `uploadStatus = READY`,

            `schemaInferenceStatus = FAILED`, and its current `dataSchema`

            unchanged. Always null in `uploadArtifact` responses.
          oneOf:
            - $ref: '#/components/schemas/ArtifactInferenceError'
            - enum:
                - null
              nullable: true
              type: object
        inferenceRefusal:
          description: >-
            Populated only by `runArtifactSchemaInference` when the Workspace's
            model

            policy refused schema inference: no processor received

            the sample. The artifact remains available with `uploadStatus =
            READY`,

            `schemaInferenceStatus = SKIPPED_BY_POLICY`, and its current
            `dataSchema`

            unchanged; `inference` and `inferenceError` are null. Always null in

            `uploadArtifact` responses.
          oneOf:
            - $ref: '#/components/schemas/ModelPolicyRefusal'
            - enum:
                - null
              nullable: true
              type: string
        sampleRows:
          description: >-
            Preview rows from the parsed sample, used to seed the schema editor.

            Each row is a `Parable_SchemaData` keyed by field name, conforming
            to

            the artifact's current `dataSchema` (header-only all-`String` after

            CSV upload; the inferred schema after `runArtifactSchemaInference`).

            Empty for non-CSV uploads, which are not parsed at upload time.
          items:
            description: A Parable Schema in JSON
            type: object
          type: array
      required:
        - artifact
        - sampleRows
      type: object
    ResponseLinks:
      properties:
        first:
          nullable: true
          type: string
        last:
          nullable: true
          type: string
        next:
          nullable: true
          type: string
        prev:
          nullable: true
          type: string
      type: object
    ResponseMeta:
      properties:
        requestId:
          description: Unique identifier for the request
          type: string
        totalCount:
          description: Total count of items for paginated responses
          nullable: true
          type: integer
      required:
        - requestId
      type: object
    ProblemDetails:
      description: An error response in the Problem Details format (RFC 9457).
      properties:
        code:
          description: The stable error code, when the problem has one.
          example: WA-VL-001
          type: string
        detail:
          description: What went wrong with this request.
          type: string
        details:
          description: >-
            Structured facts about the refusal, such as the entity or the path
            it concerns. Only some refusals have it.
        errors:
          description: >-
            The fields or filters that failed validation. Only a validation or
            filter error has it.
        requestId:
          description: >-
            The ID of the request, when the problem has one. The `X-Request-ID`
            response header always has it.
          type: string
        status:
          description: The HTTP status code.
          example: 400
          type: integer
        title:
          description: A short summary, usually the text of the HTTP status.
          example: Bad Request
          type: string
        type:
          description: >-
            The problem type. It is `about:blank`: the status and `code`
            identify the problem.
          example: about:blank
          type: string
      required:
        - type
        - title
        - status
        - detail
      type: object
    ArtifactInfo:
      description: Artifact metadata for customer display.
      properties:
        analysisWork:
          oneOf:
            - $ref: '#/components/schemas/ArtifactWorkStatus'
            - enum:
                - null
              nullable: true
              type: object
        attributedTapId:
          description: >-
            ID of the provider connection that was derived from this artifact,
            if any.

            Populated by a query-time lookup from
            `tenant_connector_tap.artifact_id`

            rather than a stored column (the inverse FK is intentionally
            one-way; see Phase 1 cycle-breaking decision). Null until the
            artifact has

            been processed and its derived tap has been created.
          nullable: true
          pattern: >-
            ^([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})$
          type: string
        createdAt:
          description: >-
            ISO8601 datetime string. Epoch wire values keep this scalar and
            declare x-temporal-format (unix, unix_millis, unix_micros,
            unix_nanos) on the property; the unit is never guessed from digit
            count.
          format: date-time
          type: string
        createdBy:
          description: UUID v4 string as base62
          pattern: ^[0-9A-Za-z]{1,22}$
          type: string
        dataSchema:
          description: Current persisted schema. Null until a schema is generated or saved.
          nullable: true
          type: object
        fileName:
          type: string
        fileSize:
          description: File size in bytes (non-negative, BIGINT-backed)
          format: int64
          maximum: 9007199254740991
          minimum: 0
          type: integer
        fileType:
          $ref: '#/components/schemas/ArtifactTypeEnum'
        id:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          pattern: >-
            ^([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})$
          type: string
        path:
          description: >-
            Virtual-folder path for this artifact, dot-separated ltree. NULL
            means

            the artifact lives at the workspace root.
          maxLength: 2048
          nullable: true
          pattern: ^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*$
          type: string
        publishWork:
          oneOf:
            - $ref: '#/components/schemas/ArtifactWorkStatus'
            - enum:
                - null
              nullable: true
              type: object
        schemaInferenceStatus:
          $ref: '#/components/schemas/ArtifactSchemaInferenceStatusEnum'
        updatedAt:
          description: >-
            ISO8601 datetime string. Epoch wire values keep this scalar and
            declare x-temporal-format (unix, unix_millis, unix_micros,
            unix_nanos) on the property; the unit is never guessed from digit
            count.
          format: date-time
          type: string
        updatedBy:
          description: UUID v4 string as base62
          pattern: ^[0-9A-Za-z]{1,22}$
          type: string
        uploadStatus:
          $ref: '#/components/schemas/ArtifactUploadStatusEnum'
        uploadedBy:
          $ref: '#/components/schemas/UserInfo'
      required:
        - id
        - createdAt
        - createdBy
        - updatedAt
        - updatedBy
        - fileName
        - fileType
        - fileSize
        - uploadStatus
        - schemaInferenceStatus
        - uploadedBy
      type: object
    ArtifactInference:
      description: |-
        Schema inference output for an uploaded artifact. The inferred schema is
        returned as a first-class `Parable_Schema` (the same shape that lives on
        the persisted `TenantArtifact.dataSchema`). Per-column inference signal
        that does not belong inside the schema itself (confidence, demotion,
        sample failure stats) lives in `columnMetadata`, keyed by `fieldPath` to
        the matching `FieldDef` in the schema.
      properties:
        columnMetadata:
          description: >-
            Per-column inference signal. Each entry references a field in
            `schema`

            via its `fieldPath` (e.g. "Inferred.email").
          items:
            $ref: '#/components/schemas/ArtifactInferenceColumnMetadata'
          type: array
        model:
          description: >-
            Provider model identifier used for inference: the model the
            Workspace's

            model policy resolved for SCHEMA_INFERENCE.
          type: string
        processor:
          description: >-
            The AI processor that ran the model. Set by
            `runArtifactSchemaInference`;

            null where the call ran no inference, as in `artifactDataPreview`.
          oneOf:
            - $ref: '#/components/schemas/ModelProcessor'
            - enum:
                - null
              nullable: true
              type: string
        schema:
          description: |-
            The inferred schema. Field rationale from the model is folded into
            `FieldDef.description` so the schema is self-documenting.
          type: object
        tokenInputCount:
          description: Input tokens consumed by the inference call.
          format: int64
          maximum: 9007199254740991
          minimum: -9007199254740991
          type: integer
        tokenOutputCount:
          description: Output tokens produced by the inference call.
          format: int64
          maximum: 9007199254740991
          minimum: -9007199254740991
          type: integer
      required:
        - schema
        - columnMetadata
        - model
        - tokenInputCount
        - tokenOutputCount
      type: object
    ArtifactInferenceError:
      description: Structured error returned when schema inference fails.
      properties:
        code:
          $ref: '#/components/schemas/WebApiArtifactError'
          description: The error code, one of the artifact error codes.
        message:
          description: Human-readable error message.
          type: string
      required:
        - code
        - message
      type: object
    ModelPolicyRefusal:
      description: >-
        Why a model call fails closed. A call never falls back to another
        processor.
      enum:
        - ENVIRONMENT_POLICY_MISSING
        - NO_ELIGIBLE_PROCESSOR
        - NO_MODEL
        - PROCESSOR_NOT_ELIGIBLE
        - MODEL_NOT_ROUTABLE
      type: string
    ArtifactWorkStatus:
      properties:
        artifactId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          pattern: >-
            ^([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})$
          type: string
        errorCode:
          oneOf:
            - $ref: '#/components/schemas/ArtifactWorkErrorCode'
            - enum:
                - null
              nullable: true
              type: string
        errorMessage:
          nullable: true
          type: string
        state:
          $ref: '#/components/schemas/ArtifactWorkState'
        tapId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          nullable: true
          pattern: >-
            ^([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})$
          type: string
        workId:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          pattern: >-
            ^([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})$
          type: string
      required:
        - workId
        - artifactId
        - state
      type: object
    ArtifactTypeEnum:
      description: Type of uploaded artifact file
      enum:
        - csv
        - xlsx
        - xls
        - numbers
        - ods
        - zip
      type: string
    ArtifactSchemaInferenceStatusEnum:
      description: Status of optional schema inference for an artifact
      enum:
        - not_requested
        - processing
        - succeeded
        - failed
        - skipped_by_policy
      type: string
    ArtifactUploadStatusEnum:
      description: Availability status of an uploaded artifact file
      enum:
        - pending
        - processing
        - ready
        - failed
      type: string
    UserInfo:
      description: |-
        A type for general info about a user for returning enough public facing
        user info for fields like createdBy or updatedBy.
      properties:
        email:
          description: An email address
          format: email
          maxLength: 255
          pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
          type: string
        id:
          description: UUID v4 with automatic base62 encoding for client-facing APIs
          pattern: >-
            ^([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})$
          type: string
        name:
          description: An objects name
          maxLength: 80
          minLength: 2
          type: string
      required:
        - id
        - name
        - email
      type: object
    ArtifactInferenceColumnMetadata:
      description: |-
        Per-column inference signal that is not encoded in the `Parable_Schema`
        itself. Linked back to the schema via `fieldPath`.
      properties:
        confidence:
          $ref: '#/components/schemas/ArtifactInferenceConfidenceEnum'
          description: Inferer's reported confidence for this column.
        demoted:
          description: |-
            True if the column was demoted by post-validation (model proposed a
            scalar that the sample data did not satisfy).
          type: boolean
        fieldPath:
          description: >-
            Path to the matching `FieldDef` in the inferred schema, formatted as

            "{typeName}.{fieldName}" (e.g. "Inferred.email"). Stable identifier
            the

            editor uses to merge this metadata with the schema.
          type: string
        firstSampleError:
          description: First sample-validation error message, when one occurred.
          nullable: true
          type: string
        sampleFailures:
          description: Number of sample values that failed validation.
          format: int64
          maximum: 9007199254740991
          minimum: -9007199254740991
          type: integer
        sampleSeen:
          description: Number of sample values evaluated against the chosen type.
          format: int64
          maximum: 9007199254740991
          minimum: -9007199254740991
          type: integer
      required:
        - fieldPath
        - confidence
        - demoted
        - sampleSeen
        - sampleFailures
      type: object
    ModelProcessor:
      description: >-
        An AI processor that may receive a Workspace's data when Parable runs a

        model over it. The Workspace model policy is a set of these: Parable
        sets

        the processors a Workspace may use, the Workspace may switch some of
        them

        off, and the environment policy caps both.
      enum:
        - VERTEX
        - OPENROUTER_ZDR
        - ANTHROPIC
        - TYPESAFE
      type: string
    WebApiArtifactError:
      description: Error codes of artifact uploads and artifact operations.
      enum:
        - WA-AF-001
        - WA-AF-002
        - WA-AF-003
        - WA-AF-004
        - WA-AF-005
        - WA-AF-006
        - WA-AF-007
        - WA-AF-008
        - WA-AF-009
        - WA-AF-010
        - WA-AF-011
        - WA-AF-012
        - WA-AF-013
        - WA-AF-014
        - WA-AF-015
        - WA-AF-016
        - WA-AF-017
        - WA-AF-018
      type: string
    ArtifactWorkErrorCode:
      enum:
        - INVALID_SOURCE
        - INVALID_SCHEMA
        - SIZE_MISMATCH
        - CHECKSUM_MISMATCH
        - ROW_COUNT_MISMATCH
        - UNSUPPORTED_FORMAT
        - STORAGE_ERROR
        - CANCELLED
        - INTERNAL_ERROR
        - DISPATCH_REJECTED
        - DISPATCH_EXHAUSTED
      type: string
    ArtifactWorkState:
      enum:
        - PENDING
        - CLAIMED
        - RUNNING
        - SUCCEEDED
        - FAILED
        - CANCELLED
      type: string
    ArtifactInferenceConfidenceEnum:
      description: Confidence level reported by schema inference for a single column.
      enum:
        - low
        - medium
        - high
      type: string
  headers:
    X-Request-ID:
      description: >-
        The ID of the request. It is the `X-Request-ID` value that you sent, or
        an ID that the server made. Give it when you report a problem.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      description: >-
        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.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.