REST API Reference
This page maps the KubeOpera REST API by area and shows the most common calls. Each service page has the complete endpoint list, and the OpenAPI descriptions have every request and response schema.
All paths below are relative to your API base URL (https://<your-kubeopera-domain>/api) and require a bearer token — see API Overview.
Endpoints by area
| Area | Gateway prefix | Service reference |
|---|---|---|
| Apps, deployments, builds, CloudSpaces, clusters | /kubeopera | kubeopera-api |
| Users, roles, tokens, SSO | /auth | auth-service |
| Health, cost, metrics | /k8s-monitor | k8s-monitor |
| Security posture | /security | Security |
| Pipelines and runs | /cicd | cicd-gateway |
| Anomalies and alert rules | /anomalies | anomaly-detector |
| Forecasts and scaling decisions | /forecasts | predictive-scaler |
| Incidents and runbooks | /incidents | incident-manager |
| AI pipeline | /agents/{observability,analysis,action,feedback,recommendation} | AI Agents |
| Agent runs | /agents/runtime | agent-runtime |
| Logs, traces, APM, SLOs | /logs, /traces, /apm, /slo | Observability services |
Common tasks
The examples use:
export KO=https://kubeopera.example.com/api
export AUTH="Authorization: Bearer $KUBEOPERA_TOKEN"
Deploy an app
curl -X POST $KO/kubeopera/api/v1/apps -H "$AUTH" -H "Content-Type: application/json" -d '{
"name": "hello",
"cloudspace_id": "b1f0…",
"source": { "type": "image", "image": "ghcr.io/stefanprodan/podinfo:6.7.0" },
"port": 9898,
"resources": { "cpu_request": "100m", "memory_request": "64Mi" },
"tls": true
}'
Follow it until it's reachable:
curl $KO/kubeopera/api/v1/apps/{id}/deploy-status -H "$AUTH"
# { "phase": "Verifying", "gitops": "Synced", "ready_replicas": 1, "reachable": false }
Scale an app
curl -X POST $KO/kubeopera/api/v1/apps/{id}/scale -H "$AUTH" \
-H "Content-Type: application/json" -d '{ "replicas": 3 }'
Roll back an app
curl $KO/kubeopera/api/v1/apps/{id}/deployments -H "$AUTH" # revision history
curl -X POST $KO/kubeopera/api/v1/apps/{id}/rollback -H "$AUTH" \
-H "Content-Type: application/json" -d '{ "revision": 4 }'
Check a cluster's health
curl $KO/k8s-monitor/api/health -H "$AUTH"
# { "healthScore": 87, "readyNodes": 5, "totalNodes": 5, "issues": [ … ] }
List open incidents
curl "$KO/incidents/api/v1/incidents?status=open" -H "$AUTH"
Approve a pending action
curl $KO/agents/action/api/v1/actions/pending -H "$AUTH"
curl -X POST $KO/agents/action/api/v1/actions/{id}/approve -H "$AUTH"
Start an AI investigation and stream it
RUN=$(curl -s -X POST $KO/agents/runtime/api/v1/runs -H "$AUTH" \
-H "Content-Type: application/json" -d '{
"agent_type": "sre_orchestrator",
"cluster_id": "prod-us-east",
"prompt": "Why did the health score drop in the last hour?"
}' | jq -r .run_id)
curl -N $KO/agents/runtime/api/v1/runs/$RUN/stream -H "$AUTH"
Report a CI run
Pipelines also accept a per-pipeline reporting token, so your CI doesn't need a user token — see Pipelines.