Remove a Kafka cluster
Destroy a cluster and all its data. A destroyed cluster can't be restored. The cluster turns destroyed at once, and we remove its brokers in the background.
The ID of the Kafka cluster to remove.
Bearer $TOKEN
{
"id": "example",
"name": "Example Kafka cluster",
"type": "KA1",
"broker_count": 50,
"replication_factor": 1,
"min_insync_replicas": 1,
"usable_storage_gb": 1,
"max_partitions": 1,
"storage_budget_bytes": 1,
"storage_budget_used_bytes": 1,
"partition_count": 50,
"engine_version": "1.4.2",
"engine_patch_version": "1.4.2",
"available_engine_versions": [
"1.4.2"
],
"status": "provisioning",
"status_message": "example",
"public_access": false,
"endpoint": {
"bootstrap_servers": "example",
"hostname": "proxy.example.com",
"port": 443,
"security_protocol": "example",
"sasl_mechanism": "example",
"brokers": [
{
"node_id": 123456789,
"hostname": "proxy.example.com"
}
],
"public_bootstrap_servers": "example",
"public_hostname": "proxy.example.com",
"public_port": 443,
"public_brokers": [
{
"node_id": 123456789,
"hostname": "proxy.example.com"
}
]
},
"brokers": [
{
"id": "example",
"node_id": 123456789,
"status": "provisioning",
"hostname": "proxy.example.com",
"disk_used_bytes": 1,
"under_replicated_partitions": 1,
"private_ips": [
{
"network_id": "123456789",
"ip_address": "example"
}
],
"last_seen_at": "2026-07-01T12:00:00.000Z"
}
],
"topics": [
{
"id": "example",
"name": "Example",
"partitions": 1,
"replication_factor": 1,
"retention_bytes": 1,
"retention_ms": 1,
"cleanup_policy": "delete",
"max_message_bytes": 1,
"budget_bytes": 1,
"created_at": "2026-07-01T12:00:00.000Z",
"updated_at": "2026-07-01T12:00:00.000Z"
}
],
"users": [
{
"id": "example",
"username": "example",
"default_user": false,
"privileges": [
{
"topic_pattern": "example",
"permission": "consume"
}
],
"created_at": "2026-07-01T12:00:00.000Z",
"updated_at": "2026-07-01T12:00:00.000Z"
}
],
"network_ids": [
"123456789"
],
"firewall_ids": [
"123456789"
],
"term": "monthly",
"created_at": "2026-07-01T12:00:00.000Z",
"updated_at": "2026-07-01T12:00:00.000Z",
"team_id": "t123",
"metadata": {
"example": "value"
}
}
{
"error": {
"message": "Malformed JSON body.",
"code": "bad_request"
}
}
{
"error": {
"message": "Missing or invalid token.",
"code": "unauthorized"
}
}
{
"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"
}
}
{
"error": {
"message": "This token is read-only and cannot be used for write operations.",
"code": "read_only_token"
}
}
{
"error": {
"message": "Resource not found.",
"code": "not_found"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Returns the Kafka cluster.
The body isn't valid JSON.
The API token is missing or invalid.
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.
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.
The resource doesn't exist, it's in another zone, or your token can't access it.
The cluster is already destroyed. The code is kafka_destroyed.
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.
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.
An unexpected, temporary error on our side, with the code internal_error. Try again.
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.
The cluster's ID, a UUID.
The cluster's name, at most 255 characters, unique among your organization's clusters that aren't destroyed or failed.
The cluster's type, such as KA1.
The number of brokers, 1 for development or 3 to survive the loss of a broker. Can't be changed after the cluster is created.
The number of copies of each partition, always equal to broker_count. Every broker stores every partition.
The number of copies that must confirm a write, 1 with one broker and 2 with three.
The storage for your topics on each broker, in GiB.
The most partitions the cluster's type allows across all topics.
The storage budget of each broker, in bytes. Every topic must fit in it.
The storage your topics reserve, in bytes. Each topic reserves its retention_bytes times its number of partitions, plus one segment for each partition.
The number of partitions across all topics.
The Kafka version as major and minor, such as 4.4.
The exact Kafka release installed, such as 4.4.0.
The version you can upgrade the cluster to, the next one we offer. The list is empty when the cluster runs the newest version.
The cluster's state.
Valid values:provisioning: We're starting the brokers and installing Kafka.running: The cluster is ready. Right after it's created, brokers can still be starting.degraded: A broker is down, partitions are missing copies or a disk is almost full. status_message says which.rescaling: We're changing the cluster's type.upgrading: We're upgrading the cluster to a newer Kafka version.failed: We couldn't create the cluster. status_message says why.destroyed: The cluster is destroyed.
Why the cluster is in its current state, such as which broker is down, or null when there's nothing to report.
Whether the cluster also has public endpoints. Clients connect with TLS and SCRAM on both the private and the public endpoints.
The addresses clients connect to, the bootstrap address and one for each broker. The fields that start with public_ are only present when public_access is on. Clients must reach every broker, not only the bootstrap address.
The bootstrap servers.
The hostname.
The port.
The security protocol.
The sasl mechanism.
The brokers.
The node id.
The hostname.
The public bootstrap servers.
The public hostname.
The public port.
The public brokers.
The node id.
The hostname.
The cluster's brokers, with their addresses on your networks and their last reported health. All brokers have the same role.
The id.
The node id.
Possible values: provisioning, starting, running, down.
The hostname.
The disk used bytes.
The under replicated partitions.
The private ips.
The network id.
The ip address.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The cluster's topics, ordered by name. Add, update or remove them with betterstack kafka-topic.
The id.
The name.
The partitions.
The replication factor.
The retention bytes.
The retention ms.
Possible values: delete, compact, compact_delete.
The max message bytes.
The budget bytes.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The cluster's users, ordered by username. Add, update or remove them with betterstack kafka-user, which also gets their passwords.
The id.
The username.
The default user.
The privileges.
The topic pattern.
Possible values: consume, produce, produce_consume.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The IDs of your networks attached to every broker. Order doesn't matter.
The ID of the firewall attached to every broker, at most one. Order doesn't matter.
The billing term. Defaults to monthly.
Valid values:monthly: Billed every month.annual: Paid for a year.
When the cluster was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
When the cluster was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The ID of the team that owns the cluster.
Your tags, as an object of string keys and values.