Rotate a Kubernetes cluster's kubeconfig

Issue a new admin token and return a new kubeconfig. Every kubeconfig you got before stops working. The old token can keep working for about 10 seconds after a rotation.

POST https://{availability_zone}.betterstackcloud.com/v1/kubernetes-clusters/{id}/kubeconfig/rotate
id string required

The ID of the Kubernetes cluster to rotate.

Authorization string required

Bearer $TOKEN

202 Accepted
{
  "kubeconfig": "example",
  "server": "example",
  "rotated_at": "2026-07-01T12:00:00.000Z"
}

Returns a JSON object with the new kubeconfig and the API URL.

kubeconfig string

The new kubeconfig, as YAML with the new admin token.

server string

The HTTPS URL of the Kubernetes API, on port 6443.

rotated_at datetime or null

When the admin token was rotated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.