---
title: "Upsert deployment"
method: PUT
path: "/v1/workspaces/{workspaceId}/deployments/{deploymentId}"
---

# Upsert deployment

`PUT /v1/workspaces/{workspaceId}/deployments/{deploymentId}`

## Path parameters

- `workspaceId` string, required
- `deploymentId` string, required

## Request body

- UpsertDeploymentRequest
  - `description` string
  - `jobAgentConfig` object
  - `jobAgentSelector` string — CEL expression to match job agents
  - `metadata` object
  - `name` string, required
  - `resourceSelector` string — CEL expression to determine if the deployment should be used
  - `slug` string, required

## Response `202`

Accepted response

- DeploymentRequestAccepted
  - `id` string, required
  - `message` string, required

## Other responses

- `400` — Invalid request
- `409` — Deployment name already exists in this workspace

## Changes

> 50 revisions in range; 1 could not be searched.

- **2026-04-23** `0cff1d88d064` — 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `409`
- **2026-04-08** `6199a729d4a1` — 2 warning
  - removed the request property `jobAgentId`
  - removed the request property `jobAgents`
- **2026-04-07** `cd9427a233bc` — 1 info
  - added the new optional request property `jobAgentSelector`
- **2026-03-11** `ac4f338f40a7` — 2 breaking
  - removed `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` from the `resourceSelector` request property `oneOf` list
  - the `resourceSelector` request property type/format changed from ``/`` to `string`/``
- **2026-02-19** `e61389fc98ac` — 1 breaking, 1 warning, 5 info
  - the `resourceSelector` request property type/format changed from `string`/`` to ``/``
  - removed the request property `jobAgentSelector`
  - added the new optional request property `jobAgentId`
  - added the new optional request property `jobAgents`
  - …3 more

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/deployments/:deploymentId/put.md)

---

[API](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api.md) · [All operations](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ctrlplanedev/ctrlplane-api/revisions/156e0d264995/schema)
