Skip to content

Cluster Configuration Changes API ​

Once you've provisioned a cluster via the Typesense Cloud web console or using the Cluster Management API, you can change its configuration using the API below.

Workflow ​

Here's a typical sequence of API Calls you'd perform when using this API:

  1. Schedule a new configuration change (which is an asynchronous process).
  2. Poll the single config change info endpoint to get the status of the configuration change.
  3. If you need to, cancel a pending configuration change.

The rest of this document will talk about the individual endpoints.

Schedule a Configuration Change ​

This endpoint lets you change the RAM, CPU, disk per node, High Availability, Search Delivery Network, node topology and Typesense Server version of a cluster that is in service.

You can skip any fields you don't want to change in the payload below.

shell
curl -X POST --location "https://cloud.typesense.org/api/v1/clusters/<ClusterId>/configuration-changes" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY" \
    -d '{
          "new_memory": "1_gb",
          "new_vcpu": "2_vcpus_2_hr_burst_per_day",
          "new_typesense_server_version": "0.24.1",
          "new_high_availability": "yes",
          "new_disk_gb_per_node": 40,
          "perform_change_at": 1787923647,
          "notification_email_addresses": ["email@example.com"]
        }'

Response:

json
{
  "success": true,
  "configuration_change": {
    "id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
    "status": "pending",
    "created_at": 1687996347,
    "updated_at": 1687996347,
    "perform_change_at": 1787923647,
    "completed_at": null,
    "old_memory": "0.5_gb",
    "old_vcpu": "2_vcpus_1_hr_burst_per_day",
    "old_gpu": null,
    "old_high_performance_disk": null,
    "old_typesense_server_version": "0.23.1",
    "old_high_availability": "no",
    "old_high_availability_node_count": null,
    "old_search_delivery_network": "off",
    "old_load_balancing": "no",
    "old_region_node_counts": {
      "oregon": 1
    },
    "old_disk_gb_per_node": 8,
    "new_memory": "1_gb",
    "new_vcpu": "2_vcpus_2_hr_burst_per_day",
    "new_gpu": null,
    "new_high_performance_disk": null,
    "new_typesense_server_version": "0.24.1",
    "new_high_availability": "yes",
    "new_high_availability_node_count": 3,
    "new_search_delivery_network": "off",
    "new_load_balancing": "yes",
    "new_region_node_counts": {
      "oregon": 3
    },
    "new_disk_gb_per_node": 40,
    "nodes_total": 1,
    "nodes_changed": 0,
    "snapshot_status": null,
    "estimated_seconds_remaining": null,
    "estimate_based_on_change_completed_at": null,
    "notification_email_addresses": [
      "email@example.com"
    ]
  }
}

Note

You can only have one configuration change active / pending at a given time.

Request Parameters ​

You can use any of the following parameters inside the payload of the above API call:

perform_change_at ​

The time at which this configuration change should be performed, as a Unix timestamp in seconds.

It can be up to one year ahead. If you send a time in the past, the change starts right away.

new_memory ​

How much RAM this cluster should have.

You can use any of the following values mentioned here.

If the new memory size can't hold the cluster's data, the change is refused when it starts. To see which sizes fit before you schedule the change, you want to get the cluster options with cluster_id.

new_vcpu ​

How many CPU cores this cluster should have.

Only certain CPU configuration are available with particular RAM configurations. The table here lists all available configurations.

new_gpu ​

When set to yes, it enables the use of a GPU to accelerate embedding generation when using built-in ML models both during indexing and searching.

Only certain RAM / CPU configurations are available with GPU acceleration. The table here lists all available configurations.

new_high_availability ​

When set to yes, at least 3 nodes are provisioned in 3 different data centers to form a highly available (HA) cluster and your data is automatically replicated between all nodes.

Note

Once High Availability is enabled, it cannot be turned off.

If you want to turn off HA, you'd need to provision a new cluster without HA, reindex your data in it and then terminate the HA cluster.

new_high_availability_node_count ​

The number of nodes for a single-region highly available cluster. Use this to scale a highly available cluster up or down between 3 and 7 nodes.

This option:

This is a shorthand for new_region_node_counts with a single region. You can only specify one of new_high_availability_node_count or new_region_node_counts.

new_search_delivery_network ​

Changes the Search Delivery Network option for the cluster.

It accepts the same values as search_delivery_network when creating a cluster: off, 3_regions, 5_regions or multi_nodes_per_region.

When changing to multi_nodes_per_region, also send new_region_node_counts to specify how many nodes go in each region.

Enabling Search Delivery Network on a cluster that doesn't already have High Availability turned on will also turn on High Availability and load balancing as part of the same change. The response will reflect this with new_high_availability and new_load_balancing set to yes.

Note

You cannot set new_high_availability to no while Search Delivery Network is enabled.

new_region_node_counts ​

An object that maps region names to the number of nodes you want in each region. Use this to change which regions the cluster runs in, and/or how many nodes run in each region.

For example, to move to a Multi-Nodes Per Region SDN cluster with 1 node in Oregon and 2 nodes in Frankfurt:

json
{
  "new_search_delivery_network": "multi_nodes_per_region",
  "new_region_node_counts": {
    "oregon": 1,
    "frankfurt": 2
  }
}

This parameter has the same shape and limits as region_node_counts when creating a cluster. The allowed number of regions and nodes depends on the cluster's target new_high_availability and new_search_delivery_network options.

You can only specify one of new_region_node_counts or new_high_availability_node_count.

Note

The region_node_counts and high_availability_node_count parameters used when creating a cluster are not accepted here. Use new_region_node_counts and new_high_availability_node_count instead.

new_high_performance_disk ​

When set to yes, the provisioned hard disk will be co-located on the same physical server that runs the node.

IMPORTANT: This option is only available when:

  • The cluster has High Availability turned on
  • The cluster does not have a burst CPU type.

new_disk_gb_per_node ​

The total disk per node in GB, including the disk the cluster's memory size comes with.

It can be any whole number of GB from the included disk up to 10 times that (or the cluster's current disk per node, if that's larger). On the cluster, disk_gb_per_node minus extra_disk_gb_per_node is the disk its current memory size includes.

Disk over the included size is extra disk, billed per GB per month on every node. Extra disk needs a payment method or prepaid credit on the account.

When you change new_memory on a cluster that has extra disk and leave this parameter out, the cluster keeps its current disk per node, unless the new memory size includes more.

If the new disk per node can't hold the cluster's data, the change is refused when it starts.

Note

Extra disk isn't available with High Performance Disk: a request that sends this parameter for a cluster with High Performance Disk, or one that turns it on with new_high_performance_disk, returns HTTP 400. Turning High Performance Disk on removes any extra disk.

new_typesense_server_version ​

The Typesense Server version to change this cluster to.

Error Responses ​

The API returns HTTP 400 and doesn't schedule the configuration change when:

  • the cluster is not In Service
  • another configuration change or a rolling restart on the cluster is scheduled or in progress
  • the cluster is the source or the target of a cloning operation that's pending or in progress
  • a backup of the cluster is running
  • the RAM, CPU and GPU combination you asked for is not available
  • new_typesense_server_version is a downgrade the cluster's current version doesn't allow
  • new_high_availability is no while Search Delivery Network is enabled
  • the payload doesn't change anything (to restart the cluster without changing its configuration, use a rolling restart)
  • a parameter isn't valid

It returns HTTP 402 when the change touches anything besides the Typesense Server version and the account has neither a payment method nor a positive prepaid credit balance.

Get single configuration change ​

This endpoint can be used to get information about a single configuration change.

shell
curl -X GET --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes/<ConfigurationChangeId>" \
    -H "Accept: application/json" \
    -H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY"

Response:

json
{
  "id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
  "status": "pending",
  "created_at": 1687996347,
  "updated_at": 1687996347,
  "perform_change_at": 1787923647,
  "completed_at": null,
  "old_memory": "0.5_gb",
  "old_vcpu": "2_vcpus_1_hr_burst_per_day",
  "old_gpu": null,
  "old_high_performance_disk": null,
  "old_typesense_server_version": "0.23.1",
  "old_high_availability": "no",
  "old_high_availability_node_count": null,
  "old_search_delivery_network": "off",
  "old_load_balancing": "no",
  "old_region_node_counts": {
    "oregon": 1
  },
  "old_disk_gb_per_node": 8,
  "new_memory": "1_gb",
  "new_vcpu": "2_vcpus_2_hr_burst_per_day",
  "new_gpu": null,
  "new_high_performance_disk": null,
  "new_typesense_server_version": "0.24.1",
  "new_high_availability": "yes",
  "new_high_availability_node_count": 3,
  "new_search_delivery_network": "off",
  "new_load_balancing": "yes",
  "new_region_node_counts": {
    "oregon": 3
  },
  "new_disk_gb_per_node": 40,
  "nodes_total": 1,
  "nodes_changed": 0,
  "snapshot_status": null,
  "estimated_seconds_remaining": null,
  "estimate_based_on_change_completed_at": null,
  "notification_email_addresses": [
    "email@example.com"
  ]
}

Response Parameters ​

status ​

The status field can be any of the following values:

statusDescription
pendingConfig change is pending execution at the specified perform_change_at timestamp.
in_progressConfig change is in progress and cannot be canceled any more.
canceledConfig change was canceled.
succeededConfig change was successfully completed. The completed_at field will give you the time when this config change was completed.
failedConfig change failed due to an internal error.

old_disk_gb_per_node and new_disk_gb_per_node ​

The total disk per node in GB before and after the change, including the disk the memory size comes with. Both are null when the change doesn't change disk per node, and on High Performance Disk.

nodes_total, nodes_changed and snapshot_status ​

How far a change has got. nodes_total is the number of nodes the change replaces, upgrades, adds or removes (a node moving to another region counts once), and nodes_changed is how many of them are done. A node counts as done once it is serving again with all its data. A scheduled change reports the cluster's current node count in nodes_total. It is 0 while a change is starting, and for a change that touches no nodes, such as turning on load balancing.

snapshot_status is the snapshot taken before any nodes change: pending, in_progress or completed. It is null when the change takes no snapshot.

estimated_seconds_remaining and estimate_based_on_change_completed_at ​

While a change is in progress, estimated_seconds_remaining is about how many seconds are left, based on how long each node took in this cluster's last configuration change. Your data may have grown since then, so treat it as an estimate. estimated_seconds_remaining is 0 once the change runs past the estimate, and null when the change is not in progress, once every node is done, or when the cluster has no earlier change to go by.

estimate_based_on_change_completed_at is the Unix timestamp of when that earlier change completed. It is null when there is no estimate.

List all configuration changes ​

This endpoint can be used to list all configuration changes for a cluster.

shell
curl -X GET --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes?per_page=1" \
    -H "Accept: application/json" \
    -H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY"

Response:

json
{
  "page": 1,
  "per_page": 1,
  "total": 10,
  "configuration_changes": [
    {
      "id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
      "status": "pending",
      "created_at": 1687996347,
      "updated_at": 1687996347,
      "perform_change_at": 1787923647,
      "completed_at": null,
      "old_memory": "0.5_gb",
      "old_vcpu": "2_vcpus_1_hr_burst_per_day",
      "old_gpu": null,
      "old_high_performance_disk": null,
      "old_typesense_server_version": "0.23.1",
      "old_high_availability": "no",
      "old_high_availability_node_count": null,
      "old_search_delivery_network": "off",
      "old_load_balancing": "no",
      "old_region_node_counts": {
        "oregon": 1
      },
      "old_disk_gb_per_node": 8,
      "new_memory": "1_gb",
      "new_vcpu": "2_vcpus_2_hr_burst_per_day",
      "new_gpu": null,
      "new_high_performance_disk": null,
      "new_typesense_server_version": "0.24.1",
      "new_high_availability": "yes",
      "new_high_availability_node_count": 3,
      "new_search_delivery_network": "off",
      "new_load_balancing": "yes",
      "new_region_node_counts": {
        "oregon": 3
      },
      "new_disk_gb_per_node": 40,
      "nodes_total": 1,
      "nodes_changed": 0,
      "snapshot_status": null,
      "estimated_seconds_remaining": null,
      "estimate_based_on_change_completed_at": null,
      "notification_email_addresses": [
        "email@example.com"
      ]
    }
  ]
}

Request Parameters ​

ParameterRequiredDescription
per_pageOptionalThe number of results per page. Default: 10
pageOptionalPage number to fetch. Default: 1

Cancel a pending configuration change ​

You can use this endpoint to cancel a pending configuration change.

shell
curl -X PATCH --location "https://cloud.typesense.org/api/v1/clusters/<ClusterID>/configuration-changes/<ConfigurationChangeId>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: YOUR-API-KEY" \
    -d '{
          "status": "canceled"
        }'

Response:

json
{
  "success": true,
  "configuration_change": {
    "id": "ecf1d570-7f49-47ef-b648-41ccf7eaf5d2",
    "status": "canceled",
    "created_at": 1687996347,
    "updated_at": 1687996347,
    "perform_change_at": 1787923647,
    "completed_at": null,
    "old_memory": "0.5_gb",
    "old_vcpu": "2_vcpus_1_hr_burst_per_day",
    "old_high_performance_disk": null,
    "old_typesense_server_version": "0.23.1",
    "old_high_availability": "no",
    "old_high_availability_node_count": null,
    "old_search_delivery_network": "off",
    "old_load_balancing": "no",
    "old_region_node_counts": {
      "oregon": 1
    },
    "old_disk_gb_per_node": 8,
    "new_memory": "1_gb",
    "new_vcpu": "2_vcpus_2_hr_burst_per_day",
    "new_high_performance_disk": null,
    "new_typesense_server_version": "0.24.1",
    "new_high_availability": "yes",
    "new_high_availability_node_count": 3,
    "new_search_delivery_network": "off",
    "new_load_balancing": "yes",
    "new_region_node_counts": {
      "oregon": 3
    },
    "new_disk_gb_per_node": 40,
    "nodes_total": 1,
    "nodes_changed": 0,
    "snapshot_status": null,
    "estimated_seconds_remaining": null,
    "estimate_based_on_change_completed_at": null,
    "notification_email_addresses": [
      "email@example.com"
    ]
  }
}

Error Responses ​

The API returns HTTP 400 when status isn't canceled, or when the configuration change isn't pending any more. It returns HTTP 404 when the cluster has no configuration change with this ID.

json
{
  "success": false,
  "message": "Only configuration changes in a `pending` status can be canceled."
}

Permissions ​

To schedule or cancel a configuration change, you need a key with the clusters:configure capability. To get or list configuration changes, you need clusters:read. See capabilities.