Skip to main content
GET
/
organizations
/
{organization}
/
databases
/
{database}
/
branches
/
{branch}
Get a branch
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/branches/{branch} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "name": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "deleted_at": "<string>",
  "restore_checklist_completed_at": "<string>",
  "schema_last_updated_at": "<string>",
  "kind": "mysql",
  "mysql_address": "<string>",
  "mysql_edge_address": "<string>",
  "state": "pending",
  "direct_vtgate": true,
  "vtgate_size": "<string>",
  "vtgate_count": 123,
  "cluster_name": "<string>",
  "cluster_iops": 123,
  "ready": true,
  "schema_ready": true,
  "metal": true,
  "production": true,
  "safe_migrations": true,
  "sharded": true,
  "shard_count": 123,
  "stale_schema": true,
  "actor": {
    "id": "<string>",
    "display_name": "<string>",
    "avatar_url": "<string>"
  },
  "restored_from_branch": {
    "id": "<string>",
    "name": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>",
    "deleted_at": "<string>"
  },
  "private_edge_connectivity": true,
  "has_replicas": true,
  "has_read_only_replicas": true,
  "html_url": "<string>",
  "url": "<string>",
  "region": {
    "id": "<string>",
    "provider": "<string>",
    "enabled": true,
    "public_ip_addresses": [
      "<string>"
    ],
    "display_name": "<string>",
    "location": "<string>",
    "slug": "<string>",
    "current_default": true
  },
  "parent_branch": "<string>",
  "vtgate_options": {}
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

organization
string
required

Organization name slug from list_organizations. Example: acme.

database
string
required

Database name slug from list_databases. Example: app-db.

branch
string
required

Branch name from list_branches. Example: main.

Response

Returns information about a branch

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
required

When the branch was deleted

restore_checklist_completed_at
string
required

When a user last marked a backup restore checklist as completed

schema_last_updated_at
string
required

When the schema for the branch was last updated

kind
enum<string>
required

The kind of branch

Available options:
mysql,
postgresql
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
enum<string>
required

The current state of the branch

Available options:
pending,
sleep_in_progress,
sleeping,
awakening,
ready
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_count
integer
required

The number of vtgate instances in the branch

cluster_name
string
required

The SKU representing the branch's cluster size

cluster_iops
integer
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

sharded
boolean
required

Whether or not the branch is sharded

shard_count
integer
required

The number of shards in the branch

stale_schema
boolean
required

Whether or not the branch has a stale schema

actor
object
required
restored_from_branch
object
required
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
parent_branch
string
required

The name of the parent branch from which the branch was created

vtgate_options
object
required

VTGate configuration options