---
search:
  tags:
    - clusters
    - POST
seo:
  description: >-
    Connects a Kubernetes cluster from its kubeconfig. Kapten then installs its
    agent on the cluster. Reference for the POST /cluster endpoint in the
    Platform API.
sidebar:
  label: Connect a cluster
  badge: POST
title: Connect a cluster
type: openapi-operation
---
Connects a Kubernetes cluster from its kubeconfig. Kapten then installs its agent on the cluster.

`POST /cluster`

**Request body** (`application/json`, required)

- `name` (string, required) — The name of the cluster.
- `cloud_provider` (cloud_provider, required) — The cloud provider for the cluster.
- `kube_config` (string, required) — The base64-encoded Kubernetes configuration for the cluster.

Request body example:

```json
{
  "name": "my-production-cluster",
  "cloud_provider": "aws",
  "kube_config": "YXBpVmVyc2lvbjogdjEKY2x1c3RlcnM6Ci0gY2x1c3RlcjoKICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiBMUzB0TFMwdENrMUZUa1JEUXk1c2NITUtMUzB0TFMwPQogICAgc2VydmVyOiBodHRwczovL2t1YmVybmV0ZXMuZXhhbXBsZS5jb20KICBuYW1lOiBleGFtcGxlLWNsdXN0ZXIK"
}
```

**Responses**

- `200` — Cluster created successfully
- `default` — Error

Response example, 200:

```json
{
  "cloud_provider": "aws",
  "created_at": "2025-06-10T22:16:02Z",
  "deleted_at": "2025-06-10T22:16:02Z",
  "id": "7362e0d0-72ed-c77b-5c42-f9af9d52fd5f",
  "name": "zKC",
  "organization_id": "7a60f26d-0106-02f5-ccf5-98b7c4cdc513",
  "state": "INITIALIZED",
  "update_at": "2025-06-10T22:16:02Z"
}
```
