# updateChannel

```graphql
mutation UpdateChannel($projectReference: ID!, $channelId: ID!, $input: UpdateChannelInput!) {
  updateChannel(projectReference: $projectReference, channelId: $channelId, input: $input) {
    id
    projectId
    platform
    name
    agentId
    enabled
    status
    installationId
    platformTeamId
    platformBotId
    workspaceName
    respondTo
    allowedSlackChannelIds
    welcomeMessage
    errorMessage
    maxResponseTokens
    runtimeTargetKind
    targetEnvironmentId
    targetBranchId
    resolvedTarget {
      resolvedInvokeMode
    }
    createdAt
    updatedAt
  }
}
```

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

## Arguments

| Name                           | Type                | Required | Description                                                                                                                                                                                                                  |
| ------------------------------ | ------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `projectReference`             | ID!                 | Yes      | Project UUID or slug.                                                                                                                                                                                                        |
| `channelId`                    | ID!                 | Yes      |                                                                                                                                                                                                                              |
| `input`                        | UpdateChannelInput! | Yes      |                                                                                                                                                                                                                              |
| `input.name`                   | String              |          |                                                                                                                                                                                                                              |
| `input.agentId`                | String              |          | Agent checked again against the selected runtime target.                                                                                                                                                                     |
| `input.respondTo`              | ChannelRespondTo    |          | One of `mentions`, `direct_messages`, `all`.                                                                                                                                                                                 |
| `input.allowedSlackChannelIds` | \[String!]          |          | Slack channel IDs. Overlap with another channel in the same workspace is rejected with resource-already-exists. At most 250 IDs; empty means every Slack channel the bot is in. A preview\_branch target needs at least one. |
| `input.welcomeMessage`         | String              |          |                                                                                                                                                                                                                              |
| `input.errorMessage`           | String              |          |                                                                                                                                                                                                                              |
| `input.maxResponseTokens`      | Int                 |          |                                                                                                                                                                                                                              |
| `input.runtimeTargetKind`      | RuntimeTargetKind   |          | Selected target; the agent is checked against it again. One of `main_branch`, `environment`, `preview_branch`.                                                                                                               |
| `input.targetEnvironmentId`    | ID                  |          |                                                                                                                                                                                                                              |
| `input.targetBranchId`         | ID                  |          |                                                                                                                                                                                                                              |

## Variables

```json
{
  "projectReference": "string",
  "channelId": "string",
  "input": {}
}
```

## Responses

| Status | Description                         |
| ------ | ----------------------------------- |
| 200    | The Channel! in data.updateChannel. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateChannel($projectReference: ID!, $channelId: ID!, $input: UpdateChannelInput!) {\n  updateChannel(projectReference: $projectReference, channelId: $channelId, input: $input) {\n    id\n    projectId\n    platform\n    name\n    agentId\n    enabled\n    status\n    installationId\n    platformTeamId\n    platformBotId\n    workspaceName\n    respondTo\n    allowedSlackChannelIds\n    welcomeMessage\n    errorMessage\n    maxResponseTokens\n    runtimeTargetKind\n    targetEnvironmentId\n    targetBranchId\n    resolvedTarget {\n      resolvedInvokeMode\n    }\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "projectReference": "string",
    "channelId": "string",
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "updateChannel": {
      "id": "string",
      "projectId": "string",
      "platform": "slack",
      "name": "string",
      "agentId": "string",
      "enabled": false,
      "status": "connected",
      "installationId": "string",
      "platformTeamId": "string",
      "platformBotId": "string",
      "workspaceName": "string",
      "respondTo": "mentions",
      "allowedSlackChannelIds": [
        "string"
      ],
      "welcomeMessage": "string",
      "errorMessage": "string",
      "maxResponseTokens": 0,
      "runtimeTargetKind": "main_branch",
      "targetEnvironmentId": "string",
      "targetBranchId": "string",
      "resolvedTarget": {
        "resolvedInvokeMode": "dispatch_override"
      },
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
