# Detach a firewall from a Kubernetes cluster

Detach a firewall from the cluster's workers. We detach it shortly after the response.

[endpoint]
method = "DELETE"
base_url = "https://{availability_zone}.betterstackcloud.com"
path = "/v1/kubernetes-clusters/{id}/firewalls/{firewall_id}"

[[path_param]]
name = "id"
required = true
type = "string"
description = "The ID of the Kubernetes cluster to detach."

[[path_param]]
name = "firewall_id"
required = true
type = "string"
description = "The ID of the firewall to detach."

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 202
description = "Returns the Kubernetes cluster."
body = '''
{
  "id": "example",
  "name": "Example Kubernetes cluster",
  "version": "1.4.2",
  "patch_version": "1.4.2",
  "available_versions": [
    "1.4.2"
  ],
  "status": "provisioning",
  "status_message": "example",
  "endpoint": {
    "hostname": "proxy.example.com",
    "port": 6443,
    "api_allowed_cidrs": [
      "example"
    ]
  },
  "pod_cidr": "10.42.0.0/16",
  "service_cidr": "10.43.0.0/16",
  "nodes_ready": 1,
  "nodes_total": 1,
  "node_pools": [
    {
      "id": "example",
      "name": "Example",
      "server_type": "example",
      "node_count": 50,
      "labels": {
        "example": "value"
      },
      "taints": [
        {
          "key": "example",
          "value": "example",
          "effect": "NoSchedule"
        }
      ],
      "status": "active",
      "status_message": "example",
      "nodes_ready": 1,
      "scaling": {
        "from": 1,
        "to": 1,
        "started_at": "2026-07-01T12:00:00.000Z",
        "estimated_ready_at": "2026-07-01T12:00:00.000Z"
      },
      "nodes": [
        {
          "id": "example",
          "name": "Example",
          "server_id": "123456789",
          "status": "queued",
          "version": "1.4.2",
          "last_seen_at": "2026-07-01T12:00:00.000Z"
        }
      ]
    }
  ],
  "network_ids": [
    "123456789"
  ],
  "firewall_ids": [
    "123456789"
  ],
  "kubeconfig_rotated_at": "2026-07-01T12:00:00.000Z",
  "latest_snapshot_at": "2026-07-01T12:00:00.000Z",
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-01T12:00:00.000Z",
  "team_id": "t123",
  "metadata": {
    "example": "value"
  }
}
'''

[[response]]
status = 400
description = "The body isn't valid JSON."
body = '''
{
  "error": {
    "message": "Malformed JSON body.",
    "code": "bad_request"
  }
}
'''

[[response]]
status = 401
description = "The API token is missing or invalid."
body = '''
{
  "error": {
    "message": "Missing or invalid token.",
    "code": "unauthorized"
  }
}
'''

[[response]]
status = 402
description = "The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is `payment_required`. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return `first_purchase`. The `url` in `first_purchase` opens a page where you make the payment. The resource is created after the payment. The page works until `expires_at`, 24 hours after the response."
body = '''
{
  "error": {
    "message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
    "code": "payment_required"
  }
}
'''

[[response]]
status = 403
description = "The request would go over a quota, with the code `quota_exceeded`. Or a read-only token tried to make a change, with the code `read_only_token`. Or a rule of the resource forbids it."
body = '''
{
  "error": {
    "message": "This token is read-only and cannot be used for write operations.",
    "code": "read_only_token"
  }
}
'''

[[response]]
status = 404
description = "The resource doesn't exist, it's in another zone, or your token can't access it."
body = '''
{
  "error": {
    "message": "Resource not found.",
    "code": "not_found"
  }
}
'''

[[response]]
status = 409
description = "The resource's state doesn't allow the request, such as starting a running server or removing a placement group that still has servers."

[[response]]
status = 423
description = "We've locked the resource, with the code `locked`. Every change to a locked resource is refused, and so is a change that involves one."

[[response]]
status = 429
description = "Too many requests, with the code `rate_limited`. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the `Retry-After` header says."

[[response]]
status = 500
description = "An unexpected, temporary error on our side, with the code `internal_error`. Try again."
body = '''
{
  "error": {
    "message": "The request could not be completed right now. Please try again in a few moments.",
    "code": "internal_error"
  }
}
'''

[[response]]
status = 503
description = "The zone has no capacity, with the code `no_capacity`. Or we couldn't set up or change the resource, with the code `orchestration_failed`. Or the organization is creating too many resources at the same time, with the code `concurrent_create_limit`. Try again after a short wait."
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The cluster's ID, a UUID."

[[param]]
name = "name"
type = "string"
description = "The cluster's name, up to 255 characters."

[[param]]
name = "version"
type = "string"
description = "The Kubernetes version as major and minor number, such as `1.36`. Defaults to the newest version."

[[param]]
name = "patch_version"
type = "string or null"
description = "The exact Kubernetes build we installed for `version`, such as `v1.37.2+k3s1`."

[[param]]
name = "available_versions"
type = "array of strings"
description = "The versions you can upgrade the cluster to now. Holds the next minor version once we offer it."

[[param]]
name = "status"
type = "string"
description = "The state of the cluster's control plane. The cluster is ready when it's `running` and every node pool has `node_count` workers that are all `ready`.<br/>Valid values:<br/>`provisioning`: We're creating the control plane and the workers.<br/>`running`: The control plane works. Check `node_pools` to see whether the workers are ready.<br/>`degraded`: The control plane or some workers aren't healthy. `status_message` says which.<br/>`upgrading`: We're upgrading the control plane and then the workers.<br/>`restoring`: We're restoring the control plane from a snapshot.<br/>`failed`: We couldn't create the cluster. `status_message` says why.<br/>`destroyed`: The cluster is deleted."

[[param]]
name = "status_message"
type = "string or null"
description = "What went wrong while creating, scaling or running the cluster, or `null`."

[[param]]
name = "endpoint"
type = "object"
description = "Where to reach the cluster's Kubernetes API, and from which IP ranges."

[[param]]
name = "endpoint.hostname"
type = "string or null"
description = "The host name of the Kubernetes API."

[[param]]
name = "endpoint.port"
type = "integer"
description = "The port of the Kubernetes API, always `6443`. Always `6443`."

[[param]]
name = "endpoint.api_allowed_cidrs"
type = "array of strings"
description = "The IP ranges allowed to reach the cluster's Kubernetes API, as 1 to 50 IPv4 or IPv6 CIDRs."

[[param]]
name = "pod_cidr"
type = "string"
description = "The IPv4 range for pods."

[[param]]
name = "service_cidr"
type = "string"
description = "The IPv4 range for Kubernetes services."

[[param]]
name = "nodes_ready"
type = "integer"
description = "How many workers were ready when we last checked."

[[param]]
name = "nodes_total"
type = "integer"
description = "How many workers the cluster has now. Each node pool's `node_count` says how many it should have."

[[param]]
name = "node_pools"
type = "array of objects"
description = "The cluster's node pools, sorted by `name`, each with its workers. Deleted node pools aren't listed."

[[param]]
name = "node_pools[].id"
type = "string"
description = "The node pool's ID, a UUID."

[[param]]
name = "node_pools[].name"
type = "string"
description = "The node pool's name."

[[param]]
name = "node_pools[].server_type"
type = "string"
description = "The server type of the workers."

[[param]]
name = "node_pools[].node_count"
type = "integer"
description = "How many workers the node pool should have."

[[param]]
name = "node_pools[].labels"
type = "object"
description = "The Kubernetes labels of the workers, as string pairs."

[[param]]
name = "node_pools[].taints"
type = "array of objects"
description = "The Kubernetes taints of the workers."

[[param]]
name = "node_pools[].taints[].key"
type = "string"
description = "The taint's key."

[[param]]
name = "node_pools[].taints[].value"
type = "string or null"
description = "The taint's value, or `null` when the taint has none."

[[param]]
name = "node_pools[].taints[].effect"
type = "string"
description = "What the taint does to pods that don't tolerate it, as in Kubernetes. Possible values: `NoSchedule`, `PreferNoSchedule`, `NoExecute`."

[[param]]
name = "node_pools[].status"
type = "string"
description = "The node pool's state. A node pool that's `active` can still have workers that aren't ready. Possible values: `active`, `scaling`, `deleting`, `destroyed`."

[[param]]
name = "node_pools[].status_message"
type = "string or null"
description = "Why the node pool has fewer workers than `node_count`, or `null`."

[[param]]
name = "node_pools[].nodes_ready"
type = "integer"
description = "How many workers of the node pool are `ready`."

[[param]]
name = "node_pools[].scaling"
type = "object or null"
description = "How a change of size is going while the node pool is `scaling`, or `null` otherwise."

[[param]]
name = "node_pools[].scaling.from"
type = "integer or null"
description = "The number of workers before the change."

[[param]]
name = "node_pools[].scaling.to"
type = "integer"
description = "The `node_count` to reach."

[[param]]
name = "node_pools[].scaling.started_at"
type = "datetime"
description = "When the change started. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "node_pools[].scaling.estimated_ready_at"
type = "datetime"
description = "When we expect the change to be done. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "node_pools[].nodes"
type = "array of objects"
description = "The node pool's workers."

[[param]]
name = "node_pools[].nodes[].id"
type = "string"
description = "The worker's ID."

[[param]]
name = "node_pools[].nodes[].name"
type = "string"
description = "The worker's name in Kubernetes."

[[param]]
name = "node_pools[].nodes[].server_id"
type = "string or null"
description = "The ID of the server that runs the worker, or `null` while the worker is `queued`."

[[param]]
name = "node_pools[].nodes[].status"
type = "string"
description = "The worker's state. Possible values: `queued`, `provisioning`, `joining`, `ready`, `not_ready`, `draining`, `replacing`, `destroyed`."

[[param]]
name = "node_pools[].nodes[].version"
type = "string or null"
description = "The Kubernetes version the worker reports."

[[param]]
name = "node_pools[].nodes[].last_seen_at"
type = "datetime or null"
description = "When we last saw the worker ready. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "network_ids"
type = "array of strings"
description = "The IDs of the private networks attached to the cluster. The list is empty while the cluster has no workers. Order doesn't matter."

[[param]]
name = "firewall_ids"
type = "array of strings"
description = "The IDs of the firewalls attached to the workers. The list is empty while the cluster has no workers. Order doesn't matter."

[[param]]
name = "kubeconfig_rotated_at"
type = "datetime or null"
description = "When the admin credentials of the kubeconfig were first issued or last rotated, or `null` before they're issued. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "latest_snapshot_at"
type = "datetime or null"
description = "When the newest `available` snapshot of the control plane was created, or `null` when there is none. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "created_at"
type = "datetime"
description = "When the cluster was created. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "updated_at"
type = "datetime"
description = "When the cluster was last updated. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "team_id"
type = "string"
description = "The ID of the team that owns the cluster. `betterstack team list` shows it."

[[param]]
name = "metadata"
type = "object"
description = "Your own tags, up to 10 string pairs."
[/params]
