Skip to content

Delete a cluster

DELETE/v1/kubernetes/clusters/{uid}

Queues deletion of the cluster and all of its nodes. The cluster and its nodes move to deleting straight away, and the cluster disappears from listings once the operation finishes.

This is asynchronous. It returns 202 Accepted with an operation_id. See Get an operation. A cluster can be deleted in any status except deleting and deleted, including while it is stopped.

X-Idempotency is optional. A retry with the same key for the same cluster returns the original operation with 200 OK and is_replay: true, even after the cluster is gone. Without a key, a repeated delete returns 409 because the cluster is already deleting.

The response's cluster includes kubeconfig when one exists.

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Path parameters

uidstringRequired

The cluster's uid.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

X-Idempotencystring

Optional unique key for this request, such as a UUID. Leading and trailing spaces are trimmed. If you send a key you already used for the same action on the same cluster, the original operation is returned with 200 OK, is_replay: true and the X-Idempotency-Replay header, and nothing new is queued. The replay is checked before the cluster's current state. Reusing a key for a different action or resource returns 409 with action: idempotency_key_reused. Keys are scoped to you and the workspace and shared by every resource type.

Response

202

The delete operation was queued.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Pass it to Get an operation.

clusterobjectRequired
Show attributes
uidstringRequired

Unique identifier of the cluster.

namestringRequired

Display name of the cluster.

slugstringRequired

URL-friendly form of the name, unique among the workspace's clusters.

statusstringRequired

Lifecycle state. failed means provisioning or a later action failed. See last_failure. deleted is only seen on Get a cluster and in idempotent replays.

stopped means the platform powered off every node because the account was suspended for non-payment. A running cluster switches to stopped (and its nodes to stopped, which ends node billing) as soon as the stop is queued, and stays stopped while the account is suspended. Within about a minute of the account becoming active again it is restarted: it goes through provisioning back to running, or to failed if the restart fails. If the stop itself fails, the cluster goes back to running and the stop is retried. A stopped cluster can still be deleted.

One ofprovisioningrunningstoppedfaileddeletingdeleted

display_statusstringRequired

Status to show in user interfaces. Currently always equal to status.

One ofprovisioningrunningstoppedfaileddeletingdeleted

zone_slugstringRequired

Zone the cluster runs in.

versionstringRequired

k3s version requested for the cluster.

image_slugstring

Slug of the node operating system image. Omitted if the image cannot be resolved.

endpointstring

Public Kubernetes API server URL. Omitted when the platform has no Kubernetes domain configured.

kubeconfigstring

kubeconfig file for the cluster, as YAML text. Omitted until the cluster is running and the kubeconfig has been retrieved. Never included by List clusters, and omitted by Get a cluster for roles without the secrets read permission. It contains credentials, so store it securely.

kubeconfig_restrictedboolean

true when kubeconfig was withheld because your role lacks the secrets read permission (viewers). Only set by Get a cluster; omitted otherwise.

last_failurestring

Reason for the last failure reported for the cluster. Omitted when there is none.

nodesarray of objects

The cluster's nodes, the control plane first. Omitted when empty.

Show item attributes
uidstringRequired

Unique identifier of the node.

namestringRequired

Node name, derived from the cluster name, such as production-cp-1 or production-worker-2.

rolestringRequired

Whether the node runs the Kubernetes control plane or workloads.

One ofcontrol-planeworker

statusstringRequired

Lifecycle state of the node. stopped while the cluster is stopped for a suspended account.

One ofprovisioningreadystoppedfaileddeletingdeleted

plan_slugstring

Compute plan the node runs on.

vcpuinteger

Virtual CPUs from the node's plan.

memory_mibinteger

Memory from the node's plan, in MiB.

disk_gibinteger

Disk included with the node's plan, in GiB.

private_ipstring

Node's private IP address. Omitted until the node is provisioned.

guest_usernamestringRequired

Operating system user for SSH access to the node.

created_atstring (date-time)Required

When the cluster was created (RFC 3339).

statusstringRequired

The cluster's status after the request was accepted, provisioning for a create or deleting for a delete. On a replay it is the cluster's current status (deleted once it is gone). This is not the operation's status; use is_completed or Get an operation for that.

events_urlstringRequired

Path of the server-sent events stream with the operation's progress.

is_replaybooleanRequired

true when an existing operation was returned for a reused X-Idempotency key.

is_completedboolean

true when a replayed operation has already finished. Omitted unless true.

Response

200

Replay. The X-Idempotency key was already used for this action, so the existing operation is returned and nothing is queued. cluster and status show the cluster as it is now (deleted once it is gone). cluster includes kubeconfig when one exists and you have the secrets.read permission; otherwise it is empty and kubeconfig_restricted is true.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Pass it to Get an operation.

clusterobjectRequired
Show attributes
uidstringRequired

Unique identifier of the cluster.

namestringRequired

Display name of the cluster.

slugstringRequired

URL-friendly form of the name, unique among the workspace's clusters.

statusstringRequired

Lifecycle state. failed means provisioning or a later action failed. See last_failure. deleted is only seen on Get a cluster and in idempotent replays.

stopped means the platform powered off every node because the account was suspended for non-payment. A running cluster switches to stopped (and its nodes to stopped, which ends node billing) as soon as the stop is queued, and stays stopped while the account is suspended. Within about a minute of the account becoming active again it is restarted: it goes through provisioning back to running, or to failed if the restart fails. If the stop itself fails, the cluster goes back to running and the stop is retried. A stopped cluster can still be deleted.

One ofprovisioningrunningstoppedfaileddeletingdeleted

display_statusstringRequired

Status to show in user interfaces. Currently always equal to status.

One ofprovisioningrunningstoppedfaileddeletingdeleted

zone_slugstringRequired

Zone the cluster runs in.

versionstringRequired

k3s version requested for the cluster.

image_slugstring

Slug of the node operating system image. Omitted if the image cannot be resolved.

endpointstring

Public Kubernetes API server URL. Omitted when the platform has no Kubernetes domain configured.

kubeconfigstring

kubeconfig file for the cluster, as YAML text. Omitted until the cluster is running and the kubeconfig has been retrieved. Never included by List clusters, and omitted by Get a cluster for roles without the secrets read permission. It contains credentials, so store it securely.

kubeconfig_restrictedboolean

true when kubeconfig was withheld because your role lacks the secrets read permission (viewers). Only set by Get a cluster; omitted otherwise.

last_failurestring

Reason for the last failure reported for the cluster. Omitted when there is none.

nodesarray of objects

The cluster's nodes, the control plane first. Omitted when empty.

Show item attributes
uidstringRequired

Unique identifier of the node.

namestringRequired

Node name, derived from the cluster name, such as production-cp-1 or production-worker-2.

rolestringRequired

Whether the node runs the Kubernetes control plane or workloads.

One ofcontrol-planeworker

statusstringRequired

Lifecycle state of the node. stopped while the cluster is stopped for a suspended account.

One ofprovisioningreadystoppedfaileddeletingdeleted

plan_slugstring

Compute plan the node runs on.

vcpuinteger

Virtual CPUs from the node's plan.

memory_mibinteger

Memory from the node's plan, in MiB.

disk_gibinteger

Disk included with the node's plan, in GiB.

private_ipstring

Node's private IP address. Omitted until the node is provisioned.

guest_usernamestringRequired

Operating system user for SSH access to the node.

created_atstring (date-time)Required

When the cluster was created (RFC 3339).

statusstringRequired

The cluster's status after the request was accepted, provisioning for a create or deleting for a delete. On a replay it is the cluster's current status (deleted once it is gone). This is not the operation's status; use is_completed or Get an operation for that.

events_urlstringRequired

Path of the server-sent events stream with the operation's progress.

is_replaybooleanRequired

true when an existing operation was returned for a reused X-Idempotency key.

is_completedboolean

true when a replayed operation has already finished. Omitted unless true.

Errors

StatusMeaning
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404No cluster with this uid exists in the workspace.
409The cluster is already being deleted or has been deleted (cluster is already deleting), or the X-Idempotency key was already used for a different operation (action: idempotency_key_reused).

Errors use the standard error format.