---
title: "Update branch"
method: PATCH
path: "/api/v1/branches/{branchId}"
tags: ["Branches"]
---

# Update branch

`PATCH /api/v1/branches/{branchId}`

## Request

- Base URL: `https://omniapp.co` (the document declares no server; this is the origin it was published from)
- URL: `https://omniapp.co/api/v1/branches/{branchId}`
- Auth: HTTP bearer

Opens the branch to Viewers and Restricted Queriers of its models, or closes it. Opening requires permission to update every model in the branch; closing requires permission to edit any one of them in a branch. The flag turns off again whenever a model is added to the branch.

## Path parameters

- `branchId` string, uuid, required: Branch ID: the org-wide branch, as `orgBranchId` on branch responses. A model-level branch ID is not accepted.

## Query parameters

- `userId` string, uuid: User ID of the user to act as, as `userId` on other endpoints. Required with an organization API key; a user-scoped key may only name its own user.

## Request body

- BranchesUpdateBody
  - `openToViewers` boolean, required: Whether users who can view a model in the branch but cannot use branches on it, Viewers and Restricted Queriers, see the branch instead of production. Turns off again whenever a model is added to the branch.

## Response `200`

Branch updated

- BranchesUpdateResponse
  - `branch` object, required: The branch after the update
    - `id` string, uuid, required: Branch ID
    - `name` string, required: Branch name
    - `openToViewers` boolean, required: Whether the branch is open to viewers
  - `success` boolean, required: Whether the operation succeeded

## Other responses

- `400`: Invalid request body, or an organization API key without userId
- `401`: Authentication required
- `403`: Permission denied - opening needs update rights on every model in the branch, closing needs branch edit rights on one
- `404`: Branch not found

## Changes

- **2026-10-27** `5775a7ba4b2f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omniapp/apis/omni-api/changes/api/v1/branches/:branchId/patch.md)

---

[API](https://skmtc.dev/omniapp/apis/omni-api.md) - [All operations](https://skmtc.dev/omniapp/apis/omni-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omniapp/apis/omni-api/revisions/76b40ebc2292?raw)
