REST API
Everything the console does goes through the KCM REST API, so scripts and pipelines can do it too. Calls are subject to the same roles, grants and audit as the console.
Base paths
| Path | Use |
|---|---|
/api/v1/... | The API: clusters, topics, consumer groups, users, access control, audit, access as code. |
/api/auth/... | Sign in, current user, sign out. |
/ws/v1/... | WebSocket of the live views, used by the console. |
/actuator/health | Health check, the only route that answers without signing in. |
Authentication
Send a token in the Authorization header: Authorization: Bearer <token>.
Service account token (recommended)
Team Create a service account, give it the access it needs, and create a named token with a validity period, read only if the script only reads. See Service accounts and tokens.
curl -s -H "Authorization: Bearer $KCM_TOKEN" https://kcm.example.com/api/auth/me
Sign in token
A local account can also get a session token. It lasts as long as a console session (one day by default) and ends with the sessions of the user. Prefer service accounts for anything that runs unattended.
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"username": "admin", "password": "..."}' \
https://kcm.example.com/api/auth/login
# {"token": "..."}
When the account has two-factor sign in, the answer is
{"mfaRequired": "true", "mfaToken": "..."} instead. Send the code within 5 minutes:
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"mfaToken": "...", "code": "123456"}' \
https://kcm.example.com/api/auth/login/mfa
If the answer also holds "passwordChangeRequired": "true", the token can only change the password:
sign in to the console once to set a new one.
Errors
Errors share one JSON format:
{
"timestamp": "2026-11-19T10:42:07.512",
"status": 409,
"error": "Conflict",
"errorCode": "KCM-1006",
"message": "RoleBinding payments-ci-topics is managed by iac:git:payments-access ...",
"path": "/api/v1/...",
"details": null
}
| Code | Meaning |
|---|---|
KCM-1001 | Bad request |
KCM-1002 | Not signed in, or the token is invalid, expired or revoked |
KCM-1003 | Forbidden: the account lacks the role or grant |
KCM-1004 | Resource not found |
KCM-1005 | Too many requests, for example a locked sign in |
KCM-1006 | The object is managed by KCM as code and is read only |
KCM-1007 | A password change is required first |
KCM-11xx | Validation errors |
KCM-12xx | Kafka and Confluent Cloud errors (connection, authorization, topic, consumer group, operation not supported on Confluent Cloud...) |
KCM-13xx | Kafka Connect errors |
KCM-14xx | Schema Registry errors |
KCM-15xx | Encryption, Kerberos and TLS errors |
KCM-16xx | License errors, for example a quota reached |
KCM-19xx | ksqlDB errors (writes disabled, statement rejected) |
Useful endpoints
| Endpoint | Purpose |
|---|---|
GET /api/auth/me | The current account and its effective permissions. |
GET /api/v1/iac/export, POST /api/v1/iac/plan,
POST /api/v1/iac/apply | Access as code, see KCM as code. |
GET|POST /api/v1/users/service-accounts,
.../service-accounts/{name}/tokens | Service accounts and tokens. |
GET /api/v1/authz/explain | Why a user has or lacks a role on a resource, see Roles and access control. |
GET /api/v1/audit, GET /api/v1/audit/export | Global audit and its CSV export, see Audit trail. |
GET /api/v1/groups/{id}/audit | Audit of one environment. |
POST /api/v1/users/me/sessions/revoke | Sign out everywhere. |
GET /actuator/health | Liveness of the API, for probes and load balancers. |
The easiest way to find the call behind a screen is the network tab of your browser's developer tools: the console only uses the documented REST API.
A dedicated command line tool is not available yet. Until then, curl and a service account token
cover every automation, and KCM as code covers access control.