Skip to main content

API Overview

KubeVision exposes a RESTful HTTP API consumed by the frontend and available for programmatic use.

Base URL

All API endpoints are mounted under:

/api/v1

When running locally this resolves to http://localhost:8080/api/v1.

Unified Response Format

Every response — success or error — uses the same JSON envelope:

{
"code": 0,
"message": "success",
"data": {},
"meta": {}
}
FieldTypeDescription
codeintBusiness status code. 0 = success. Non-zero values indicate an error. See Error Codes.
messagestringHuman-readable description of the result.
dataobject | array | nullThe response payload. null for operations that produce no output (e.g., delete).
metaobjectRequest metadata. Present on all responses.
tip

All HTTP responses return status 200. The business outcome is determined entirely by the code field. Never branch on the HTTP status code alone.

Meta Object

The meta field carries context about how the response was produced:

{
"meta": {
"source": "cache",
"stale": false,
"total": 142,
"requestId": "req_01HXYZ4B9K0VGMZS"
}
}
FieldTypeDescription
source"cache" | "apiserver"Whether the data came from the Informer cache or a live API Server call.
stalebooltrue if the cache entry is older than the configured TTL.
totalintTotal number of items for list endpoints. Used for pagination display.
requestIdstringUnique identifier for this request. Include this in bug reports.

Content Type

All requests must include:

Content-Type: application/json

All responses are returned as application/json; charset=utf-8.

Authentication

Requests must include a valid JWT in the Authorization header:

Authorization: Bearer <access_token>

See Authentication for how to obtain tokens.