Skip to main content
The Cluster Management API enables you to create, update, monitor, and delete CockroachDB Cloud clusters across all plan types: Basic, Standard, and Advanced.

List All Clusters

Retrieve all active clusters within your organization.
GET /v1/clusters
curl --request GET \
  --url https://cockroachlabs.cloud/api/v1/clusters \
  --header "Authorization: Bearer {secret_key}"

Query Parameters

show_inactive
boolean
default:"false"
Include deleted or failed clusters in the response

Response

clusters
array
Array of cluster objects
{
  "clusters": [
    {
      "id": "f9b6f5e4-3c2b-4a1d-9e8f-7c6b5a4d3e2f",
      "name": "production-cluster",
      "plan": "STANDARD",
      "provider": "GCP",
      "state": "CREATED",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Cluster Details

Retrieve detailed information about a specific cluster.
GET /v1/clusters/{cluster_id}
curl --request GET \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
  --header "Authorization: Bearer {secret_key}"
The cluster ID used in the Cloud API is different from the routing ID used when connecting to clusters.

Create a Basic Cluster

Create a new CockroachDB Basic cluster with usage-based pricing.
POST /v1/clusters
curl --request POST \
  --url https://cockroachlabs.cloud/api/v1/clusters \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "basic-test",
    "provider": "GCP",
    "plan": "BASIC",
    "spec": {
      "serverless": {
        "regions": ["us-central1"]
      }
    }
  }'

Request Parameters

name
string
required
Cluster name (6-20 characters, lowercase letters, numbers, dashes)
provider
enum
required
Cloud provider: AWS, GCP, or AZURE
plan
enum
required
Set to BASIC for a Basic cluster
spec.serverless.regions
array
required
Array of region names (e.g., ["us-central1"])
spec.serverless.usage_limits.storage_mib_limit
string
Maximum storage in MiB (optional)
spec.serverless.usage_limits.request_unit_limit
string
Maximum request units per month (optional)

Create a Standard Cluster

Create a CockroachDB Standard cluster with provisioned capacity.
POST /v1/clusters
curl --request POST \
  --url https://cockroachlabs.cloud/api/v1/clusters \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "standard-cluster",
    "provider": "GCP",
    "plan": "STANDARD",
    "spec": {
      "serverless": {
        "regions": ["us-central1"],
        "usage_limits": {
          "provisioned_virtual_cpus": "2"
        }
      }
    }
  }'

Request Parameters

name
string
required
Cluster name
provider
enum
required
Cloud provider: AWS, GCP, or AZURE
plan
enum
required
Set to STANDARD for a Standard cluster
spec.serverless.usage_limits.provisioned_virtual_cpus
string
required
Number of provisioned vCPUs (minimum 2)

Create an Advanced Cluster

Create a CockroachDB Advanced cluster with dedicated resources.
POST /v1/clusters
curl --request POST \
  --url https://cockroachlabs.cloud/api/v1/clusters \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "advanced-cluster",
    "provider": "AWS",
    "plan": "ADVANCED",
    "spec": {
      "dedicated": {
        "region_nodes": {
          "us-east-1": 3
        },
        "hardware": {
          "machine_spec": {
            "num_virtual_cpus": 4
          }
        }
      }
    }
  }'

Request Parameters

name
string
required
Cluster name
provider
enum
required
Cloud provider: AWS, GCP, or AZURE
plan
enum
required
Set to ADVANCED for an Advanced cluster
spec.dedicated.region_nodes
object
required
Object mapping region names to node counts (minimum 3 nodes per region)
spec.dedicated.hardware.machine_spec.num_virtual_cpus
integer
required
Number of vCPUs per node
spec.dedicated.cockroach_version
string
CockroachDB version (e.g., v23.1.2). Defaults to latest if omitted.

Update Cluster Resources

Modify cluster resources such as vCPUs, storage limits, or provisioned capacity.

Update Basic Cluster Limits

PATCH /v1/clusters/{cluster_id}
curl --request PATCH \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "serverless": {
      "usage_limits": {
        "storage_mib_limit": "5242880",
        "request_unit_limit": "100000000"
      }
    }
  }'

Update Standard Cluster vCPUs

PATCH /v1/clusters/{cluster_id}
curl --request PATCH \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "serverless": {
      "usage_limits": {
        "provisioned_virtual_cpus": "4"
      }
    }
  }'
You can decrease provisioned capacity only three times within a 7-day period. You can increase capacity at any time.

Update Advanced Cluster Hardware

PATCH /v1/clusters/{cluster_id}
curl --request PATCH \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
  --header "Authorization: Bearer {secret_key}" \
  --header "Content-Type: application/json" \
  --data '{
    "spec": {
      "dedicated": {
        "hardware": {
          "machine_spec": {
            "num_virtual_cpus": 8
          }
        }
      }
    }
  }'

Get Cluster Nodes

Retrieve information about nodes in a cluster.
GET /v1/clusters/{cluster_id}/nodes
curl --request GET \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/nodes \
  --header "Authorization: Bearer {secret_key}"

Response

{
  "nodes": [
    {
      "name": "node-1",
      "region_name": "us-central1",
      "status": "LIVE"
    },
    {
      "name": "node-2",
      "region_name": "us-central1",
      "status": "LIVE"
    }
  ]
}
nodes
array

Delete a Cluster

Permanently delete a cluster and all its data.
DELETE /v1/clusters/{cluster_id}
curl --request DELETE \
  --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id} \
  --header "Authorization: Bearer {secret_key}"
Deleting a cluster is permanent and irreversible. All data within the cluster will be lost. Deleted clusters cannot be restored.

List Available Regions

Get available regions for creating clusters.
GET /v1/clusters/available-regions
curl --request GET \
  --url 'https://cockroachlabs.cloud/api/v1/clusters/available-regions?provider=GCP' \
  --header "Authorization: Bearer {secret_key}"

Query Parameters

provider
enum
required
Cloud provider: AWS, GCP, or AZURE

Response

{
  "regions": [
    "us-central1",
    "us-east1",
    "us-west1",
    "europe-west1",
    "asia-southeast1"
  ]
}

Required Permissions

OperationRequired Role
List clustersCluster Developer, Cluster Admin
Get cluster detailsCluster Developer, Cluster Admin
Create clusterCluster Creator, Cluster Admin
Update clusterCluster Developer, Cluster Admin
Delete clusterCluster Creator, Cluster Admin
List available regionsCluster Developer, Cluster Admin

Build docs developers (and LLMs) love