---
title: "Preview schema change"
method: POST
path: "/v4/templates/{templateId}/preview-schema-change"
tags: ["Templates"]
---

# Preview schema change

`POST /v4/templates/{templateId}/preview-schema-change`

## Request

- Base URL: `https://api.kadoa.com`
- URL: `https://api.kadoa.com/v4/templates/{templateId}/preview-schema-change`
- Auth: API key in header `x-api-key`

Preview the data a schema change would produce for one linked workflow, without applying the template or running the workflow

## Path parameters

- `templateId` string, uuid, required

## Request body

- SchemaChangePreviewBody: Request body for previewing a schema change without applying it
  - `workflowId` string, uuid, required: Linked workflow to preview
  - `targetVersion` integer, required: Template version to preview

## Response `200`

200

- SchemaChangePreviewResponse: Read-only AI-generated preview of how a schema change affects one linked workflow's data
  - `error` false, required: Error flag (always false on success)
  - `data` object, required
    - `workflowId` string, uuid, required
    - `workflowName` string, required
    - `currentVersion` integer, required
    - `targetVersion` integer, required
    - `basis` 'existing_data' | 'configuration_only', required
    - `columns` object[], required
      - `name` string, required
      - `label` string, required
      - `dataType` string, required: Target datatype, or the previous datatype for a removed field
      - `previousDataType` string, nullable, required: Effective datatype before the schema change, if any
      - `beforeValueSource` 'observed' | 'none', required: Where the before value came from: observed in stored output, or none
      - `afterValueSource` 'observed' | 'simulated' | 'none', required: Where the after value came from: observed, simulated by the model, or none
      - `truncated` boolean: Whether a value for this field was truncated to fit the preview budget; absent means not truncated
      - `status` 'unchanged' | 'removed' | 'added' | 'updated', required
    - `beforeRows` object[], required
    - `rows` object[], required
    - `truncated` boolean, required: Whether any preview value was truncated to fit the data budget

## Other responses

- `400`: 400
- `401`: 401
- `404`: 404
- `500`: 500

---

[API](https://skmtc.dev/kadoa/apis/kadoa-api.md) · [All operations](https://skmtc.dev/kadoa/apis/kadoa-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kadoa/apis/kadoa-api/revisions/bf7803c927b4?raw)
