# Undeploy Workflow

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

## Description
Remove the active deployment. API execution, schedules, and trigger webhooks stop; deployment versions stay in history. 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 undeployed.

```json
{
  "type": "object",
  "properties": {
    "isDeployed": {
      "type": "boolean",
      "description": "Whether the workflow has an active deployment."
    },
    "deployedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the active deployment was created."
    },
    "apiKey": {
      "type": [
        "string",
        "null"
      ],
      "description": "Which API keys can execute the deployment: `Workspace API keys` or `Personal API keys`. Never a key value."
    },
    "needsRedeployment": {
      "type": "boolean",
      "description": "Whether the saved workflow differs from the active deployment."
    },
    "isPublicApi": {
      "type": "boolean",
      "description": "Whether the deployment can be executed without an API key."
    }
  }
}
```

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