# Change a channel's settings or target

```http
PATCH /projects/{project_reference}/channels/{channel_id}
```

Update a channel binding. Requires project.channels.write.

## Parameters

| Name                | In   | Required | Description                                                |
| ------------------- | ---- | -------- | ---------------------------------------------------------- |
| `project_reference` | path | Yes      | Project slug, UUID, or domain that identifies the project. |
| `channel_id`        | path | Yes      |                                                            |

## Request body

| Field                       | Type         | Required | Description                                                                                                                                                                                                                                                               |
| --------------------------- | ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agent_id`                  | string       |          | Agent from the same runtime target; checked against the selected target again. Omission keeps the current agent. Updating does not require the caller Slack connection.                                                                                                   |
| `name`                      | string       |          | Display name, 1-255 characters                                                                                                                                                                                                                                            |
| `respond_to`                | string       |          | Which Slack messages to answer: mentions, direct\_messages or all                                                                                                                                                                                                         |
| `allowed_slack_channel_ids` | array        |          | Slack channel IDs. Overlap with another channel in the same workspace is rejected with resource-already-exists. IDs come from listSlackChannels (MCP: list\_slack\_channels); empty means every Slack channel the bot is in. A preview\_branch target needs at least one. |
| `welcome_message`           | string,null  |          | Welcome message. Omission keeps the value; null clears it.                                                                                                                                                                                                                |
| `error_message`             | string,null  |          | Error message. Omission keeps the value; null clears it.                                                                                                                                                                                                                  |
| `max_response_tokens`       | integer,null |          | Maximum response tokens. Omission keeps the value; null clears it.                                                                                                                                                                                                        |
| `runtime_target_kind`       | string       |          | Runtime target: main\_branch, environment or preview\_branch                                                                                                                                                                                                              |
| `target_environment_id`     | string,null  |          | Environment ID; required when runtime\_target\_kind is environment                                                                                                                                                                                                        |
| `target_branch_id`          | string,null  |          | Branch ID; required when runtime\_target\_kind is preview\_branch                                                                                                                                                                                                         |

## Responses

| Status | Description     |
| ------ | --------------- |
| 200    | Updated channel |
| 400    | Bad request     |
| 401    | Unauthorized    |
| 403    | Forbidden       |
| 404    | Not found       |
| 409    | Conflict        |
| 500    | Server error    |
