---
title: "Update a branch"
method: PUT
path: "/branches/{branch_id}"
tags: ["Management"]
---

# Update a branch

`PUT /branches/{branch_id}`

Update branch

## Path parameters

- `branch_id` integer, required

## Request body

- Branch
  - `id` integer
  - `created` string, date-time
  - `name` string
  - `branch_name` string
  - `project_id` integer
  - `project_name` string
  - `forking_model` string
  - `stages` Stage[]
    - `id` integer
    - `name` string, required
    - `branch_id` integer
    - `branch_name` string
    - `schema` object
      - `parent` string
      - `triggers` object
        - `parent` boolean
      - `parameters` object[]
        - `name` string
        - `default` string
    - `schema_code` string
    - `enabled` boolean
  - `flows` object
  - `retention_policy` RetentionPolicy
    - `ci_logs` integer
    - `dev_logs` integer
    - `ci_artifacts` integer
    - `dev_artifacts` integer
  - `env_vars` object

## Response `200`

Successfully

- Branch
  - `id` integer
  - `created` string, date-time
  - `name` string
  - `branch_name` string
  - `project_id` integer
  - `project_name` string
  - `forking_model` string
  - `stages` Stage[]
    - `id` integer
    - `name` string, required
    - `branch_id` integer
    - `branch_name` string
    - `schema` object
      - `parent` string
      - `triggers` object
        - `parent` boolean
      - `parameters` object[]
        - `name` string
        - `default` string
    - `schema_code` string
    - `enabled` boolean
  - `flows` object
  - `retention_policy` RetentionPolicy
    - `ci_logs` integer
    - `dev_logs` integer
    - `ci_artifacts` integer
    - `dev_artifacts` integer
  - `env_vars` object

## Changes

- **2026-07-17** `1f2ae877f985` — 2 info
  - added the new optional request property `env_vars`
  - added the optional property `env_vars` to the response with the `200` status
- **2023-04-02** `663cd77f4c7a` — 2 info
  - added the new optional request property `created`
  - added the optional property `created` to the response with the `200` status
- **2023-02-18** `7796ef19a4c9` — 2 info
  - added the new optional request property `retention_policy`
  - added the optional property `retention_policy` to the response with the `200` status
- **2021-07-09** `6f4f98f500b0` — 1 breaking, 3 info
  - the response property `name` became optional for the status `200`
  - added the new optional request property `forking_model`
  - the request property `name` became optional
  - added the optional property `forking_model` to the response with the `200` status
- **2021-01-31** `ecd12e02213d` — 2 info
  - added optional request body
  - added the media type `application/json` for the response with the status `200`

[Full history](https://skmtc.dev/kraken-ci/apis/server-api/changes/branches/:branch_id/put.md)

---

[API](https://skmtc.dev/kraken-ci/apis/server-api.md) · [All operations](https://skmtc.dev/kraken-ci/apis/server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/kraken-ci/server-api/revisions/1f2ae877f985/schema)
