Skip to main content
PATCH
/
organizations
/
{organization}
/
databases
/
{database}
/
branches
/
{branch}
/
changes
Upsert a change request
curl --request PATCH \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/branches/{branch}/changes \
  --header 'Authorization: <api-key>'
{
  "id": "<string>",
  "restart": [
    123
  ],
  "state": "queued",
  "started_at": "<string>",
  "completed_at": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "actor": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "cluster_name": "<string>",
  "cluster_display_name": "<string>",
  "cluster_metal": true,
  "replicas": 123,
  "parameters": {},
  "previous_cluster_name": "<string>",
  "previous_cluster_display_name": "<string>",
  "previous_cluster_metal": true,
  "previous_replicas": 123,
  "previous_parameters": {},
  "minimum_storage_bytes": 123,
  "maximum_storage_bytes": 123,
  "storage_autoscaling": true,
  "storage_shrinking": true,
  "storage_type": "gp3",
  "storage_iops": 123,
  "storage_throughput_mibs": 123,
  "previous_minimum_storage_bytes": 123,
  "previous_maximum_storage_bytes": 123,
  "previous_storage_autoscaling": true,
  "previous_storage_shrinking": true,
  "previous_storage_type": "<string>",
  "previous_storage_iops": 123,
  "previous_storage_throughput_mibs": 123
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization that owns this resource

database
string
required

The name of the database that owns this resource

branch
string
required

The name of the branch that owns this resource

Response

Returns the branch change request

id
string
required

The ID of the branch change request

restart
number[]
required

The ports requiring a restart when changes are applied

state
enum<string>
required

The state of the branch change request

Available options:
queued,
pending,
resizing,
canceled,
completed
started_at
string
required

The time the branch change request started

completed_at
string
required

The time the branch change request completed

created_at
string
required

The time the branch change request was created

updated_at
string
required

The time the branch change request was last updated

actor
object
required
cluster_name
string
required

The SKU representing the branch cluster

cluster_display_name
string
required

The SKU representing the branch cluster for display

cluster_metal
boolean
required

Whether or not this is a metal database

replicas
number
required

The total number of replicas

parameters
object
required

The branch parameters

previous_cluster_name
string
required

The previous SKU representing the branch cluster

previous_cluster_display_name
string
required

The previous SKU representing the branch cluster for display

previous_cluster_metal
boolean
required

Whether or not the previous SKU was a metal database

previous_replicas
number
required

The previous total number of replicas

previous_parameters
object
required

The previous branch parameters

minimum_storage_bytes
number
required

The minimum storage size in bytes

maximum_storage_bytes
number
required

The maximum storage size in bytes

storage_autoscaling
boolean
required

Whether storage autoscaling is enabled

storage_shrinking
boolean
required

Whether storage shrinking is enabled when autoscaling is enabled

storage_type
enum<string>
required

The storage type (gp3 or io2)

Available options:
gp3,
io2,
pd_ssd
storage_iops
number
required

The storage IOPS

storage_throughput_mibs
number
required

The storage throughput in MiB/s

previous_minimum_storage_bytes
number
required

The previous minimum storage size in bytes

previous_maximum_storage_bytes
number
required

The previous maximum storage size in bytes

previous_storage_autoscaling
boolean
required

Whether storage autoscaling was previously enabled

previous_storage_shrinking
boolean
required

Whether storage shrinking was previously enabled

previous_storage_type
string
required

The previous storage type

previous_storage_iops
number
required

The previous storage IOPS

previous_storage_throughput_mibs
number
required

The previous storage throughput in MiB/s

I