---
title: "Swap models on agent variations"
method: POST
path: "/v1/workspaces/{workspaceId}/models:swapModelOnVariations"
tags: ["ModelService", "Models"]
---

# Swap models on agent variations

`POST /v1/workspaces/{workspaceId}/models:swapModelOnVariations`

Reassigns agent variations from one model to another in bulk. Runs asynchronously and returns immediately.

## Path parameters

- `workspaceId` string, required

## Request body

- SwapModelOnVariationsRequest — Swap model on variations request. Each ModelSwap reassigns every agent variation on current_model_id to next_model_id. The work runs asynchronously.
  - `workspaceId` string — Workspace ID.
  - `modelSwaps` SwapModelOnVariationsRequestModelSwap[] — The swaps to perform.
    - `currentModelId` string — The model variations are currently on. Accepts an id or "external_id:" slug.
    - `nextModelId` string — The model to move variations to. Accepts an id or "external_id:" slug.
    - `disableCurrentAfterSwap` boolean — Whether to disable the current model after the swap.

## Response `200`

OK

- SwapModelOnVariationsResponse — Swap model on variations response. Empty: the work runs asynchronously, so no counts are returned (a large data set would make the call slow).

## Other responses

- `default` — Default error response

---

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