Skip to the page

Reference · Control API

Control API

The API behind the console and the CLI manages clusters, schemas, keys, sign-in and shard placement.

In the schema
—

Authentication and scopes#

Authenticate requests to https://api.napalmdata.com by passing an org token (napalm_…) in the Authorization: Bearer header. An org token acts as the manager who created it and is scoped to a single organization.

Value-blind org tokens

napalm_… tokens carry read or manage control scope for one organization and can never read or mutate application rows inside a project.

Tracked asynchronous operations

Cluster provisioning, scaling, backups and shard moves return 202 Accepted with a pollable /operations/{id} state record and audit trail.

readscope
Permits all GET endpoints plus read-only inspection routes (such as query compilation checks and access reach previews).
managescope
Permits all state-changing operations: provisioning clusters, pushing schemas, issuing or revoking keys, configuring sign-in and running backups or shard migrations.

Org tokens cannot read or mutate application rows inside your projects. See Sessions and keys for token creation and renewal.

List your projects · curl
curl https://api.napalmdata.com/projects \  -H "Authorization: Bearer $NAPALM_TOKEN"

API sections#

Projects
Project provisioning, API settings, service keys, access policy auditing, authentication providers, webhooks, S3 file imports and query telemetry.
Schema & branches
Schema migrations, query typechecking, deployed query catalogs, branch creation and point-in-time restores, and GitHub pull-request automation.
Actions, handlers & schedules
External and hosted action handlers, ES256 caller assertion exchange, handler machine pools and secrets, cron schedules and background job queues.
Distribution
Root placement analysis, multi-shard bucket distribution, online bucket moves, shard splits, regional pinning, single-root point-in-time recovery and core copies.
Clusters
Cluster provisioning, vertical and replica scaling, maintenance holds, base backups, point-in-time restores, primary switchovers and managed storage for files, the change log and search.
Organization & billing
Organization profile, monthly metered usage and spend caps, org tokens, CLI login handshakes and immutable audit events.

Request and response conventions#

Payload limits
A request body holds up to 16 KiB. A schema change takes up to 1 MiB with up to 512 KiB of schema. A query deployment takes up to 4 MiB, and a handler bundle up to 128 MiB. A POST route without parameters expects {}.
Strict deserialization
Request and response fields use camelCase. Unknown fields or missing required properties are rejected with HTTP 422 rather than silently ignored.
Tenant isolation
Resources belonging to another organization return HTTP 404 Not Found to prevent cross-organization enumeration.
Operations
Long-running infrastructure changes return HTTP 202 Accepted with an operation and a Location: /operations/{id} header.
Ending resources
A route that ends a resource names the resource in the path and the kind of ending in the verb. remove is for resources the org made, revoke for a credential or a membership and cancel for work under way. Those routes take no body. Webhooks are named in the body, because a webhook’s URL is its only identifier.
Caching
All Control API responses include Cache-Control: no-store.
202 Accepted operation response
HTTP/1.1 202 AcceptedLocation: /operations/0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e6f {  "operation": {    "id": "0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e6f",    "operationType": "shardBackup",    "status": "pending",    "clusterId": "0192c3f0-1122-7334-8445-556677889900",    "insertTime": "2026-11-08T18:20:00Z"  }}

Operations#

RouteDescriptionScope
GET /operations/{id}Fetch the current status, progress metadata and result or error of an operationScoperead
GET /operations/{id}/events#List chronological step transitions and diagnostic events recorded by the operationScoperead
POST /operations/{id}/retry#Retry a failed or timed-out operation after inspecting the failure causeScopeNapalm’s admins

GET/operations/{id}#

Control’s work on a cluster or branch runs asynchronously as an operation. Provisioning a cluster, scaling machines, taking a backup, restoring a shard, moving buckets and importing files all answer 202 Accepted and return Location: /operations/{id}. Each operation moves from pending to running and ends in completed, failed or timeout. Operations differ from a project’s own jobs, which are deployed queries that the project’s app queues. See Jobs.

Operation object

iduuid
Operation identifier returned in operation.id and the Location header.
operationTypestring
Workflow discriminator such as clusterProvision, clusterScale, shardBackup, shardRestore, bucketMove, shardSplit or fileImport.
statusstring
Current lifecycle state: pending, running, completed, failed or timeout.
stepstring | null
Active phase on multi-step online operations, such as copying, catchingUp, draining and clearing on a bucket or root move.
errorstring | null
Failure or timeout reason from the newest run, or null while running or completed.
runsobject[]
Execution attempts ordered newest first, each recording id, status, startTime, aliveTime, finishTime and error.

Poll GET /operations/{id} every 2 to 5 seconds, or run napalm operations show <id> --wait in the CLI. Read GET /operations/{id}/events for up to 100 audit events per operation, newest first, covering the request, worker claim and outcome. When an operation ends in failed or timeout, the control plane halts automatic retries and records the reason in operation.error. A Napalm admin inspects the cluster state before re-running the operation through POST /operations/{id}/retry.

Poll an operation · curl
curl https://api.napalmdata.com/operations/$OPERATION \  -H "Authorization: Bearer $NAPALM_TOKEN"
Running operation
{  "operation": {    "id": "0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e6f",    "operationType": "bucketMove",    "status": "running",    "clusterId": "0192c3f0-1122-7334-8445-556677889900",    "orgId": "3c8f1a2e-9b4d-4e7c-a1f6-5d2b8e0c9a47",    "projectId": "8a4d2c10-5e3b-4f9a-8c12-6d7e8f9a0b1c",    "branch": "main",    "bucket": 12,    "sourceShard": "shard-a1b2c3d4e5",    "targetShard": "shard-k3m9x2p7qa",    "isAutomatic": false,    "step": "catchingUp",    "placementVersion": null,    "startTime": "2026-11-08T18:20:02Z",    "finishTime": null,    "error": null,    "insertTime": "2026-11-08T18:20:00Z",    "updateTime": "2026-11-08T18:20:09Z",    "parentId": null,    "runs": [      {        "id": "0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e70",        "status": "running",        "startTime": "2026-11-08T18:20:02Z",        "aliveTime": "2026-11-08T18:20:09Z",        "finishTime": null,        "error": null      }    ]  }}
Failed operation
{  "operation": {    "id": "0192c3f4-6b1a-7d8e-9f00-1a2b3c4d5e6f",    "operationType": "shardRestore",    "status": "failed",    "clusterId": "0192c3f0-1122-7334-8445-556677889900",    "branch": "main",    "targetTime": "2026-11-07T09:30:00Z",    "startTime": "2026-11-08T18:20:02Z",    "finishTime": "2026-11-08T18:21:14Z",    "error": "base backup prior to targetTime was not found on shard-a1b2c3d4e5"  }}

Error catalog#

Structured Control API errors are JSON in the shape { "error": { "code": "…", "message"?: "…" } }. Requests that fail transport-level parsing (exceeding byte limits or invalid JSON syntax) get plain-text 413 or 422 responses.

HTTPError codeDescription
400invalid_requestDescriptionMalformed parameter value or out-of-range configuration field.
400schema_invalidDescriptionThe engine rejected the submitted SDL migration or query (includes compiler diagnostic details).
401unauthorizedDescriptionMissing, expired or revoked organization bearer token.
402monthly_limit_reachedDescriptionProvisioning or scaling would push monthly projected infrastructure spend above the organization quota.
402monthly_cap_reachedDescriptionProvisioning or scaling would exceed the self-imposed monthly spend cap configured by organization managers.
402payment_overdueDescriptionAn invoice payment failed. New provisioning and scaling operations are paused until the payment is resolved.
403forbiddenDescriptionThe caller does not have permission to access the target organization.
403manage_scope_requiredDescriptionA read-scoped token attempted to call a state-changing endpoint.
404not_foundDescriptionThe requested project, cluster, branch, key or job does not exist in the caller’s organization.
409conflictDescriptionState conflict, such as no unassigned cluster available for a new project or a duplicate resource name.
409cluster_busyDescriptionAnother operation is already running on the target cluster.
409cluster_unavailableDescriptionThe cluster is not yet provisioned or has been torn down.
409backups_not_configuredDescriptionBackup or restore requested on a cluster without configured backup storage.
409files_not_configuredDescriptionFile operations requested on a project whose cluster has no file storage.
409change_log_not_configuredDescriptionA change log read, a change log retention setting or a rows webhook requested on a cluster that keeps no change log.
409branch_distributedDescriptionThe request is not possible yet for a branch spread over more than one shard.
409key_limit_reachedDescriptionThe branch already holds 500 live service keys. Revoke an existing key on the branch first.
409label_takenDescriptionThe requested project or storage label is already in use.
409host_takenDescriptionThe custom domain is already bound to or pending verification on another bucket.
409volume_fullDescriptionThe target shard volume exceeds the 80% utilization threshold required to create or copy a branch.
409branch_copy_failedDescriptionThe branch-copy operation failed while the request was waiting. message holds the operation’s error, and operationId names the failed operation.
409github_not_configuredDescriptionGitHub repository integration is not configured on the control plane.
413—DescriptionThe request body is over the route’s limit: 16 KiB on most routes, 1 MiB for a schema change, 4 MiB for a query deployment and 128 MiB for a handler bundle.
422—DescriptionUnrecognized field or missing required JSON property.
500internal_errorDescriptionUnexpected server error. Idempotent reads are safe to retry.
503github_unavailableDescriptionUpstream GitHub API request timed out or failed. Retry shortly.

Type a word or two to search every docs page.