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

PathUse
/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/healthHealth 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
}
CodeMeaning
KCM-1001Bad request
KCM-1002Not signed in, or the token is invalid, expired or revoked
KCM-1003Forbidden: the account lacks the role or grant
KCM-1004Resource not found
KCM-1005Too many requests, for example a locked sign in
KCM-1006The object is managed by KCM as code and is read only
KCM-1007A password change is required first
KCM-11xxValidation errors
KCM-12xxKafka and Confluent Cloud errors (connection, authorization, topic, consumer group, operation not supported on Confluent Cloud...)
KCM-13xxKafka Connect errors
KCM-14xxSchema Registry errors
KCM-15xxEncryption, Kerberos and TLS errors
KCM-16xxLicense errors, for example a quota reached
KCM-19xxksqlDB errors (writes disabled, statement rejected)

Useful endpoints

EndpointPurpose
GET /api/auth/meThe current account and its effective permissions.
GET /api/v1/iac/export, POST /api/v1/iac/plan, POST /api/v1/iac/applyAccess as code, see KCM as code.
GET|POST /api/v1/users/service-accounts, .../service-accounts/{name}/tokensService accounts and tokens.
GET /api/v1/authz/explainWhy a user has or lacks a role on a resource, see Roles and access control.
GET /api/v1/audit, GET /api/v1/audit/exportGlobal audit and its CSV export, see Audit trail.
GET /api/v1/groups/{id}/auditAudit of one environment.
POST /api/v1/users/me/sessions/revokeSign out everywhere.
GET /actuator/healthLiveness 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.

Command line tool

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.