GET
/
organizations
/
{organization}
/
databases
/
{database}
/
branches
List branches
curl --request GET \
  --url https://api.planetscale.com/v1/organizations/{organization}/databases/{database}/branches \
  --header 'Authorization: <api-key>'
{
  "current_page": 123,
  "next_page": 123,
  "next_page_url": "<string>",
  "prev_page": 123,
  "prev_page_url": "<string>",
  "data": [
    {
      "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",
      "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>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Path Parameters

organization
string
required

The name of the organization the branch belongs to

database
string
required

The name of the database the branch belongs to

Query Parameters

q
string

Search branches by name

production
boolean

Filter branches by production status

safe_migrations
boolean

Filter branches by safe migrations (DDL protection)

order
enum<string>

Order branches by created_at time

Available options:
asc,
desc
page
number
default:1

If provided, specifies the page offset of returned results

per_page
number
default:25

If provided, specifies the number of returned results

Response

Returns database branches

current_page
number
required

The current page number

next_page
number
required

The next page number

next_page_url
string
required

The next page of results

prev_page
number
required

The previous page number

prev_page_url
string
required

The previous page of results

data
object[]
required