---
title: "Update a branch"
method: PATCH
path: "/v0/projects/{project}/branches/{branch}"
tags: ["projects", "branches"]
---

# Update a branch

`PATCH /v0/projects/{project}/branches/{branch}`

Update a branch for a project. The user must have `edit` permissions for the project, or provide a valid project key for the project (no rename).

## Path parameters

- `branch` string, required
- `project` string, required

## Request body

- JsonUpdateBranch
  - `archived` boolean, nullable — Set whether the branch is archived.
  - `name` string
  - `slug` string
  - `start_point` JsonUpdateStartPoint
    - `branch` string
    - `clone_thresholds` boolean, nullable — If set to `true`, the thresholds from the start point branch will be deep copied to the branch. This can be useful for pull request branches that should have the same thresholds as their target branch. Requires the `branch` field to be set.
    - `hash` string
    - `max_versions` integer, nullable — The maximum number of historical branch versions to include. Versions beyond this number will be omitted. The default is 255. Requires the `branch` field to be set.
    - `reset` boolean, nullable — Reset the branch head to an empty state. If the start point `branch` is specified, the new branch head will begin at that start point. Otherwise, the branch head will be reset to an empty state.

## Response `200`

successful operation

- JsonBranch
  - `archived` string, date-time
  - `created` string, date-time, required
  - `head` JsonHead, required
    - `created` string, date-time, required
    - `replaced` string, date-time
    - `start_point` JsonStartPoint
      - `branch` string, uuid, required
      - `head` string, uuid, required
      - `version` JsonVersion, required
        - `hash` string
        - `number` integer, required
    - `uuid` string, uuid, required
    - `version` JsonVersion
      - `hash` string
      - `number` integer, required
  - `modified` string, date-time, required
  - `name` string, required
  - `project` string, uuid, required
  - `slug` string, required
  - `uuid` string, uuid, required

## Other responses

- `4XX` — Error
- `5XX` — Error

---

[API](https://skmtc.net/bencherdev/apis/bencher-api.md) · [All operations](https://skmtc.net/bencherdev/apis/bencher-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bencherdev/bencher-api/versions/84086e99e6cd/schema)
