---
title: "POST /api/ee/replacement/replace-model-with-transform"
method: POST
path: "/api/ee/replacement/replace-model-with-transform"
tags: ["/api/ee/replacement"]
---

# POST /api/ee/replacement/replace-model-with-transform

`POST /api/ee/replacement/replace-model-with-transform`

Create a transform from a model, execute it, and replace all usages of the model
   with the output table. Un-persists the model and converts it to a saved question.
   Returns 202 with a run_id for polling.

   If there is an error during the transform execution, no replacement will be
   performed and the model will remain unchanged.

   If there is an error during the source swap, the transform and the output
   table will be retained, and the model will remain unchanged. We cannot delete
   the transform or the output table because they can be used by other queries at
   this point.

## Request body

- object
  - `card_id` union, required
    - integer — Valid Card ID
    - integer — Valid Table ID
  - `target_collection_id` union
    - integer — Valid Card ID
    - integer — Valid Table ID
  - `transform_name` string, required
  - `transform_tag_ids` integer[], nullable
  - `transform_target` object, required

## Response `2XX`

Successful response

- object
  - `body` object, required
    - `run_id` integer, required
  - `status` unknown, required

## Other responses

- `4XX` — Client error response
- `5XX` — Server error response

---

[API](https://skmtc.net/metabase/apis/metabase-api.md) · [All operations](https://skmtc.net/metabase/apis/metabase-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/metabase/metabase-api/revisions/08b5a2bafb4f/schema)
