---
title: "Update a branch"
method: PATCH
path: "/organizations/{organization}/databases/{database}/branches/{branch}"
tags: ["Database branches"]
---

# Update a branch

`PATCH /organizations/{organization}/databases/{database}/branches/{branch}`

### Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:

**Service Token Accesses**
 `write_database`

**OAuth Scopes**

 | Resource | Scopes |
| :------- | :---------- |
| Organization | `write_branches`, `write_databases` |
| Database | `write_branches`, `write_database` |
| Branch | `write_branch` |

## Path parameters

- `organization` string, required
- `database` string, required
- `branch` string, required

## Request body

- object
  - `new_name` string — The name to update the branch
  - `deletion_protected` boolean — Whether deletion protection is enabled for the branch

## Response `200`

Returns the updated branch

- object
  - `id` string, required — The ID of the branch
  - `name` string, required — The name of the branch
  - `created_at` string, required — When the branch was created
  - `updated_at` string, required — When the branch was last updated
  - `deleted_at` string, nullable, required — When the branch was deleted
  - `restore_checklist_completed_at` string, nullable, required — When a user last marked a backup restore checklist as completed
  - `schema_last_updated_at` string, nullable, required — When the schema for the branch was last updated
  - `kind` 'mysql' | 'postgresql', required — The kind of branch
  - `mysql_address` string, required — The MySQL address for the branch
  - `mysql_edge_address` string, required — The address of the MySQL provider for the branch
  - `state` 'pending' | 'sleep_in_progress' | 'sleeping' | 'awakening' | 'ready', required — The current state of the branch
  - `direct_vtgate` boolean, required — True if the branch allows passwords to connect directly to a vtgate, bypassing load balancers
  - `vtgate_size` string, required — The size of the vtgate cluster for the branch
  - `vtgate_name` string, nullable, required — The public SKU representing the VTGate size
  - `vtgate_count` integer, required — The number of vtgate instances in the branch
  - `vtgate_autoscaling` boolean, required — Whether VTGate autoscaling is enabled
  - `vtgate_max_count` integer, nullable, required — The maximum number of VTGate instances when autoscaling is enabled
  - `vtgate_target_cpu_utilization` integer, nullable, required — The target CPU utilization for VTGate autoscaling
  - `cluster_name` string, required — The SKU representing the branch's cluster size
  - `cluster_iops` integer, nullable, required — IOPS for the cluster
  - `ready` boolean, required — Whether or not the branch is ready to serve queries
  - `schema_ready` boolean, required — Whether or not the schema is ready for queries
  - `metal` boolean, required — Whether or not this is a metal database
  - `production` boolean, required — Whether or not the branch is a production branch
  - `safe_migrations` boolean, required — Whether or not the branch has safe migrations enabled
  - `deletion_protected` boolean, required — Whether deletion protection is enabled for the branch
  - `sharded` boolean, required — Whether or not the branch is sharded
  - `shard_count` integer, required — The number of shards in the branch
  - `keyspace_count` integer, required — The number of keyspaces in the branch
  - `stale_schema` boolean, required — Whether or not the branch has a stale schema
  - `actor` object, nullable, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `restored_from_branch` object, nullable, required
    - `id` string, required — The ID for the resource
    - `name` string, required — The name for the resource
    - `created_at` string, required — When the resource was created
    - `updated_at` string, required — When the resource was last updated
    - `deleted_at` string, nullable, required — When the resource was deleted, if deleted
  - `private_edge_connectivity` boolean, required — True if private connections are enabled
  - `has_replicas` boolean, required — True if the branch has replica servers
  - `has_read_only_replicas` boolean, required — True if the branch has read-only replica servers
  - `html_url` string, required — Planetscale app URL for the branch
  - `url` string, required — Planetscale API URL for the branch
  - `region` object, required
    - `id` string, required — The ID of the region
    - `provider` string, required — Provider for the region (ex. AWS)
    - `enabled` boolean, required — Whether or not the region is currently active
    - `public_ip_addresses` string[], required — Public IP addresses for the region
    - `display_name` string, required — Name of the region
    - `location` string, required — Location of the region
    - `slug` string, required — The slug of the region
    - `current_default` boolean, required — True if the region is the default for new branch creation
    - `mysql_supported` boolean, required — Whether the region supports MySQL/Vitess databases
    - `postgresql_supported` boolean, required — Whether the region supports PostgreSQL databases
  - `parent_branch` string, nullable, required — The name of the parent branch from which the branch was created
  - `vtgate_options` object, required — VTGate configuration options

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-08-13** `69bdece4890a` — 1 breaking
  - removed the required property `deletion_protection_managed` from the response with the `200` status
- **2026-08-12** `fd4480152110` — 4 info
  - added the new optional request property `deletion_protected`
  - the request property `new_name` became optional
  - added the required property `deletion_protected` to the response with the `200` status
  - added the required property `deletion_protection_managed` to the response with the `200` status
- **2026-08-11** `4b2e4f05bda2` — 4 info
  - added the required property `vtgate_autoscaling` to the response with the `200` status
  - added the required property `vtgate_max_count` to the response with the `200` status
  - added the required property `vtgate_name` to the response with the `200` status
  - added the required property `vtgate_target_cpu_utilization` to the response with the `200` status
- **2026-07-08** `fa19f3305241` — 1 info
  - added the required property `keyspace_count` to the response with the `200` status
- **2026-06-01** `72506953f367` — 8 breaking, 2 info
  - the response property `actor` became nullable for the status `200`
  - the response property `cluster_iops` became nullable for the status `200`
  - the response property `deleted_at` became nullable for the status `200`
  - the response property `parent_branch` became nullable for the status `200`
  - …6 more

[Full history](https://skmtc.dev/planetscale/apis/planetscale-api/changes/organizations/:organization/databases/:database/branches/:branch/patch.md)

---

[API](https://skmtc.dev/planetscale/apis/planetscale-api.md) · [All operations](https://skmtc.dev/planetscale/apis/planetscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/planetscale/planetscale-api/revisions/6d28c038c4fd/schema)
