---
title: "Undeploy a cluster"
method: POST
path: "/clusters/{clusterId}/_undeploy"
tags: ["Clusters"]
---

# Undeploy a cluster

`POST /clusters/{clusterId}/_undeploy`

Undeploy the cluster from the gateway. Sets lifecycle state to UNDEPLOYED.

A Kafka virtual cluster cannot be undeployed while a started Kafka Native API is bound to it
(via a `native-kafka-virtual-cluster` endpoint): the request is rejected with 400 so the
started API is never left pointing at an undeployed cluster.

## Response `200`

Cluster undeployed

- Cluster
  - `id` string
  - `crossId` string — Portable identifier for cross-environment references. Immutable after creation.
  - `type` 'KAFKA_CLUSTER_STANDALONE' | 'KAFKA_CLUSTER' | 'KAFKA_VIRTUAL_CLUSTER'
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `name` string
  - `description` string
  - `configuration` object
  - `groups` string[]
  - `lifecycleState` 'UNDEPLOYED' | 'DEPLOYED' | 'PENDING' — Current lifecycle state of the cluster.
  - `deployedAt` string, date-time — Last deployment or undeployment timestamp.
  - `version` integer — Deployment version, incremented on each deploy.

## Other responses

- `400` — The Kafka virtual cluster cannot be undeployed because one or more started Kafka Native APIs are bound to it. Stop those APIs first.
- `default` — Generic error response

---

[API](https://skmtc.net/gravitee-io/apis/gravitee-io-apim-management-api-environments.md) · [All operations](https://skmtc.net/gravitee-io/apis/gravitee-io-apim-management-api-environments/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gravitee-io/gravitee-io-apim-management-api-environments/versions/37e8cbe5f769/schema)
