Reference · Control API
Clusters
Provision, scale, back up and restore clusters, and place maintenance holds.
- In the schema
- —
Provisioning and inspection#
Cluster routes provision dedicated compute and PostgreSQL shards, scale engines and replicas online, manage maintenance holds and configure object, search and backup storage.
Dedicated engines, primaries and replicas
Provision solo, standard or multi-shard scale topologies and resize engines, replicas and shard counts online without dropping traffic.
Base backups and point-in-time recovery
Every cluster starts with nightly base backups, on-demand shard snapshots, configurable 7 to 90 day retention windows and controlled switchovers.
| Route | Description | Scope |
|---|---|---|
GET /clusters# | List all clusters in the organization with topology, status and monthly rate | Scoperead |
POST /clusters | Provision a new cluster (returns 202 Accepted with the provisioning operation) | Scopemanage |
GET /clusters/{id}# | Read one cluster with the members’ current roles and state, the machines and the storage | Scoperead |
GET /# | List the operations run on the cluster, newest first | Scoperead |
GET /# | Inspect branch volume utilization per shard and suggested branch rebalancing moves | Scoperead |
GET /clusters/{id}/state# | Read failover status, each shard’s primary and the settings version applied on each machine | Scoperead |
GET /machine-sizes# | List the machine sizes a cluster can take, by CPU type | Scoperead |
POST/clusters#
Request body
- namestringrequired
- Cluster name (1–128 characters).
- shapestringrequired
- Topology preset:
solo(one database machine and one engine),standard(primary and replica) orscale(two or more database machines). - membersobject[]required
- First shard’s PostgreSQL machines, primary first. Each item specifies
region(three-letter airport code such asiad),cpuType(sharedorperformancefor dedicated CPUs),cpus,memoryBytes(in 256 MiB steps fromGET /machine-sizes) andvolumeSizeBytes(whole GiB). - enginesobject[]required
- Stateless Napalm engines, each taking
region,cpuType(sharedorperformancefor dedicated CPUs),cpusandmemoryBytes. - labelstring | null
- Subdomain label (1–40 lowercase letters, digits and inner hyphens) for
<label>.napalmdata.comand file bucket hosts. Set once across Napalm (409 label_takenwhen already claimed).
Every new cluster runs the latest verified Napalm engine package and starts with nightly base backups and a 7-day point-in-time restore window. Track provisioning progress with GET /operations/{id}, then create a project on the ready cluster with POST /projects.
curl https://api.napalmdata.com/clusters \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "name": "production", "shape": "standard", "label": "notes", "members": [ { "region": "iad", "cpuType": "performance", "cpus": 2, "memoryBytes": 4294967296, "volumeSizeBytes": 10737418240 }, { "region": "iad", "cpuType": "performance", "cpus": 2, "memoryBytes": 4294967296, "volumeSizeBytes": 10737418240 } ], "engines": [ { "region": "iad", "cpuType": "shared", "cpus": 2, "memoryBytes": 2147483648 }, { "region": "iad", "cpuType": "shared", "cpus": 2, "memoryBytes": 2147483648 } ] }{ "operation": { "id": "0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e6f", "operationType": "clusterProvision", "status": "pending", "clusterId": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "orgId": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47", "insertTime": "2026-11-10T14:12:00Z" }}Scaling and maintenance holds#
| Route | Description | Scope |
|---|---|---|
POST / | Change the engine count, CPU and memory, the database machines’ CPU and memory, the replicas per shard or the number of data shards | Scopemanage |
POST /clusters/{id}/hold# | Place or change a hold on Napalm’s own maintenance of the cluster, such as nightly backups and certificate renewals | Scopemanage |
POST /# | Lift the hold so the waiting maintenance runs | Scopemanage |
POST /# | Set the restore window to 7, 14, 30 or 90 days | Scopemanage |
POST/clusters/{id}/scales#
Request body
- engineCountintegerrequired
- Total stateless engines (at least 1).
- engineCpuTypestringrequired
- CPU class for every engine:
sharedorperformance(dedicated CPUs). - engineMemoryBytesintegerrequired
- Memory per engine in bytes, in 256 MiB steps from 512 MiB (
GET /machine-sizes). - engineCpusinteger
- CPUs per engine (
GET /machine-sizes). When omitted, CPU count follows memory. - memberCpuTypestringrequired
- CPU class for every database machine:
sharedorperformance(dedicated CPUs). - memberMemoryBytesintegerrequired
- Memory per database machine in bytes, in 256 MiB steps (
GET /machine-sizes). - memberCpusinteger
- CPUs per database machine (
GET /machine-sizes). When omitted, CPU count follows memory. - replicaCountintegerrequired
- Replicas per data shard beside the primary (at least 1 on a cluster with automatic failover).
- dataShardCountintegerrequired
- Total data shards on the cluster (at least the cluster’s current data shard count).
Scaling runs online and returns 202 Accepted with a clusterScale operation. The operation updates engines first, one at a time, so the endpoint keeps serving. Any new data shards provision next, and database machines resize last, replicas before the primary.
curl https://api.napalmdata.com/clusters/$CLUSTER/scales \ -H "Authorization: Bearer $NAPALM_TOKEN" \ -H "Content-Type: application/json" \ -d { "engineCount": 4, "engineCpuType": "shared", "engineMemoryBytes": 2147483648, "memberCpuType": "performance", "memberMemoryBytes": 8589934592, "replicaCount": 2, "dataShardCount": 1 }{ "operation": { "id": "0192c401-8d2c-7e1f-a300-4b5c6d7e8f90", "operationType": "clusterScale", "status": "pending", "clusterId": "7a1e9c2b-4d3f-4b8a-9e6c-2f1d0b8a7c35", "orgId": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47", "engineCount": 4, "engineCpuType": "shared", "engineMemoryBytes": 2147483648, "memberCpuType": "performance", "memberMemoryBytes": 8589934592, "replicaCount": 2, "dataShardCount": 1, "insertTime": "2026-11-10T16:45:00Z" }}POST /clusters/{id}/hold
- reasonstringrequired
- The hold’s purpose, up to 256 characters.
- expireTimestringrequired
- When the hold lifts, in RFC 3339. The time must be in the future and at most a week after the hold is placed.
Backups, restores and switchovers#
| Route | Description | Scope |
|---|---|---|
GET /# | List completed base backups and the continuous point-in-time recovery window per shard | Scoperead |
POST /# | Trigger an immediate on-demand base backup of main’s shard or a named shard | Scopemanage |
POST /# | Perform a controlled primary-to-replica switchover on a shard | Scopemanage |
Restores are per branch. Request a restore with POST /projects/{id}/branch-restores. See Scale and recovery for details on base backups, restore windows and automatic vs. manual switchovers.
Storage, search and custom domains#
| Route | Description | Scope |
|---|---|---|
POST /# | Keep a change log for the cluster with a retentionDays window | Scopemanage |
POST /# | Provision public and private buckets for ext::files::File records | Scopemanage |
POST /# | Trigger an immediate garbage-collection sweep for unreferenced stored files | Scopemanage |
POST /# | Bind a custom domain to the project’s public file bucket | Scopemanage |
POST /# | Provision or renew TLS certificates for the cluster’s custom endpoints | Scopemanage |
POST /# | Give the cluster a dedicated bucket for search indexes | Scopemanage |
POST /# | Trigger an immediate sweep of the search bucket | Scopemanage |
GET /# | List the cluster’s search indexes with each index’s tier and unpublished rows | Scoperead |
POST /# | Publish a search index now, or retrain the index | Scopemanage |
POST /# | Choose the storage tier a search index keeps | Scopemanage |
Spend limits and concurrency#
Cluster provisioning and scaling requests are checked against two monthly ceilings before any compute capacity is allocated.
- monthly_limit_reached (402)Organization quota
- Returned when the projected monthly run-rate of active machines plus current-month metered overages would exceed the organization’s approved quota ($0 until a card is added, then starting at $500/mo and doubling with each paid monthly invoice up to $8,000/mo).
- payment_method_required (402)No card
- Returned when the organization has no card. A card is needed before the first machine.
- payment_failed (402)Card declined
- Returned when the card declines the upfront charge for the requested machines through the end of the month. error.message carries the card issuer’s reason, and nothing is created.
- billing_unavailable (503)Billing
- Returned when the billing provider cannot process the upfront charge right now. Nothing is charged or created.
- monthly_cap_reached (402)Manager spend cap
- Returned when the operation would exceed the self-imposed monthly spend cap configured via POST /org/spend-limits.
- payment_overdue (402)Billing hold
- Returned when the organization has an unpaid past-due invoice.
Only one infrastructure operation may run on a cluster at a time, so concurrent mutation requests return 409 cluster_busy. Background file and search sweeps run independently and only serialize against other sweeps of the same kind.
Torn-down clusters#
When a cluster is decommissioned (state: "tornDown"), Napalm releases its machines, volumes and network addresses and disables the associated project API. Catalog metadata is preserved for audit history. File buckets stop serving traffic but keep stored objects for 60 days (bucketDeletionTime), and then Napalm deletes every bucket. Remove any custom domain’s CNAME record that points at a file bucket before then. Once a bucket is deleted, another customer who claims the bucket name could serve files on any domain still pointing at it.