# Update Deployment Version

`PATCH /api/workflows/{id}/deployments/{version}`

## Description
Rename or describe a deployment version, or make it the active version with `isActive: true`. Activating rolls the deployment back or forward to that version without changing the saved workflow. Editing the name or description needs write access (a write grant for scoped keys). Activating needs admin access (an admin grant for scoped keys).

## Parameters

- **id** (path) (required) — `string`: The unique identifier of the workflow.

- **version** (path) (required) — `integer`: The deployment version number, as listed by List Deployments.

## Request Body

```json
{
  "type": "object",
  "description": "At least one field is required.",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "isActive": {
      "type": "boolean",
      "enum": [
        true
      ],
      "description": "Send `true` to make this the active version."
    }
  }
}
```

## Responses

### 200 — Activation returns `success`, `deployedAt`, and `warnings`, plus `name` and `description` when they were also changed. A metadata-only update returns `name` and `description`.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "deployedAt": {
      "type": "string",
      "format": "date-time"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
```

### 400 — The body is empty or invalid, or `version` is not a number.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 403 — The key's owner lacks write or admin access to the workflow in its workspace.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 404 — The requested resource was not found. Verify the ID is correct and belongs to your workspace.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```
