# Update Deployment Settings

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

## Description
Turn public execution on or off. A public deployment can be executed without an API key. Turning it on returns 403 when public API access is turned off for the SteelEngine instance or for the owner's permission group. Successful updates record a `workflow.public_api_updated` audit event with the actor and previous/new `isPublicApi` values; API-key requests also record the key ID and type. 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.

## Request Body

```json
{
  "type": "object",
  "required": [
    "isPublicApi"
  ],
  "properties": {
    "isPublicApi": {
      "type": "boolean",
      "description": "Whether the deployment can be executed without an API key."
    }
  }
}
```

## Responses

### 200 — The setting was saved.

```json
{
  "type": "object",
  "properties": {
    "isPublicApi": {
      "type": "boolean"
    }
  }
}
```

### 400 — `isPublicApi` is missing or not a boolean.

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