# Deploy Workflow

`POST /api/workflows/{id}/deploy`

## Description
Deploy the workflow's saved state as a new active version. Trigger webhooks, schedules, and MCP tools are synced the same way as the Deploy button. The request has no body. Requires admin access to the workflow's workspace, the same permission the Deploy button needs. The key acts as its owner, so the owner's current workspace role must allow it. A scoped or organization key also needs an admin grant on the workspace or workflow; a key without one is rejected with 401.

## Parameters

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

## Responses

### 200 — The workflow was deployed.

```json
{
  "type": "object",
  "properties": {
    "isDeployed": {
      "type": "boolean"
    },
    "deployedAt": {
      "type": "string",
      "format": "date-time"
    },
    "apiKey": {
      "type": [
        "string",
        "null"
      ],
      "description": "Which API keys can execute the deployment: `Workspace API keys` or `Personal API keys`. Never a key value."
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Non-fatal problems found while syncing triggers or schedules."
    }
  }
}
```

### 400 — The workflow failed deploy validation, for example an invalid schedule.

```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 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."
    }
  }
}
```
