---
title: "Change the branch an app deploys from"
method: POST
path: "/client/services/{id}/branch"
tags: ["Apps"]
---

# Change the branch an app deploys from

`POST /client/services/{id}/branch`

## Request

- Base URL: `https://api.roar-ai.com`
- URL: `https://api.roar-ai.com/client/services/{id}/branch`
- Auth: HTTP bearer

Send `{ "branch": "staging" }`. Refused unless GitHub confirms the branch exists. Deploys nothing: the next push to that branch, or a redeploy, ships it. `id` is a SERVICE id — take it from `services[].id` on `GET /client/apps/{appId}`, not the app id itself. Requires `apps:deploy`.

## Path parameters

- `id` string, uuid, required

## Request body

- object

## Response `200`

Changed

## Other responses

- `400`: No such branch, or GitHub could not be asked
- `404`: No such service for you

---

[API](https://skmtc.dev/roar-ai/apis/roar-ai-api.md) · [All operations](https://skmtc.dev/roar-ai/apis/roar-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/roar-ai/apis/roar-ai-api/revisions/37e4d0d5a7fe?raw)
