---
title: "Update Channel"
method: PATCH
path: "/apps/{app_id}/channels/{channel_id}"
---

# Update Channel

`PATCH /apps/{app_id}/channels/{channel_id}`

## Request

- Base URL: `https://api.xhostd.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xhostd.com/apps/{app_id}/channels/{channel_id}`
- Auth: none declared

Change a channel's branch binding, whether it follows that branch, or both.

The scope and role are ``create_channel``'s: ``channel:*`` and a
MEMBER. The branch does not have to exist in the repo yet.
``channels/service.py::set_binding`` validates the binding and
journals the change.

Turning ``follows_branch`` on also takes ``deploy:*``, because from
then on each GitHub push deploys the channel. It needs a GitHub
connection and a binding (``channels/service.py::set_follows_branch``).
Turning it off is always accepted. A body that carries both fields
applies the binding first, so one request can bind a branch and
follow it.

## Path parameters

- `app_id` string, uuid, required
- `channel_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- UpdateChannelRequest: The fields ``PATCH`` can change. An omitted field stays as it is. An explicit ``null`` is refused for both: a channel cannot be unbound, and following is on or off.
  - `git_ref_binding` string, nullable
  - `follows_branch` boolean, nullable

## Response `200`

Successful Response

- ChannelResponse
  - `id` string, uuid, required
  - `name` string, required
  - `hostname` string, required
  - `git_ref_binding` string, nullable, required
  - `follows_branch` boolean, required
  - `current_sha` string, nullable, required
  - `status` string, required
  - `pending_deploy` PendingDeployResponse, required: The channel's in-flight deploy, if one is queued or running.
    - `deploy_id` string, uuid, required
    - `sha` string, required
    - `status` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xhostd/apis/xhostd-public.md) · [All operations](https://skmtc.dev/xhostd/apis/xhostd-public/llms.txt) · [OpenAPI document](https://skmtc.dev/xhostd/apis/xhostd-public/revisions/bf439c4d1789?raw)
