---
title: "Replace Scenarios"
method: PUT
path: "/dataTables/{data_table_id}/scenarios"
tags: ["DataTable"]
---

# Replace Scenarios

`PUT /dataTables/{data_table_id}/scenarios`

Reconcile the scenarios of a DataTable to exactly the provided set (a bulk replace). Scenarios whose id matches an existing row are updated, scenarios without a matching id are created, and existing rows absent from the request are removed. Prefer this over issuing many per-scenario create, update, and delete calls when replacing a DataTable's rows.

## Path parameters

- `data_table_id` string, required

## Request body

- ScenarioReconcileRequest — The complete desired set of scenarios for a DataTable bulk replace
  - `scenarios` Scenario[], required — The full set of scenarios the DataTable should contain after the request. Include an id to update an existing scenario; omit it to create a new one. Existing scenarios not present here are removed.
    - `id` string
    - `table_id` string — The ID of the DataTable parent table
    - `workspace_id` string — The ID of the workspace associated with this DataTable
    - `name` string — The display name for the scenario
    - `variables` Variable[] — The variable names and values for this scenario. All scenarios must have the same set of variable names to maintain consistency.
      - `name` string — The variable name
      - `value` string — The value associated with the variable defined in the "name" field
    - `created_time` integer — Time at which the entity was created
    - `created_by_id` string — The ID of the user who created this entity
    - `last_updated_time` integer — Time at which the entity was last updated
    - `last_updated_by_id` string — The ID of the user who last updated this entity

## Response `200`

The reconciled scenarios

- ScenarioQueryResult — Results wrapper for Scenario queries
  - `scenarios` Scenario[] — All Scenarios matching the query
    - `id` string
    - `table_id` string — The ID of the DataTable parent table
    - `workspace_id` string — The ID of the workspace associated with this DataTable
    - `name` string — The display name for the scenario
    - `variables` Variable[] — The variable names and values for this scenario. All scenarios must have the same set of variable names to maintain consistency.
      - `name` string — The variable name
      - `value` string — The value associated with the variable defined in the "name" field
    - `created_time` integer — Time at which the entity was created
    - `created_by_id` string — The ID of the user who created this entity
    - `last_updated_time` integer — Time at which the entity was last updated
    - `last_updated_by_id` string — The ID of the user who last updated this entity
  - `cursor` string — Cursor used for pagination

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `409` — The DataTable was modified concurrently; retry with the latest state
- `default` — Unknown error

---

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