Authentication
API keys are the recommended way to authenticate programmatic access. See API Keys.
curl -H "Authorization: Bearer <API_KEY>" \
"https://<DASHBOARD_URL>/api/v1/workloads"API Specification
Cluster Targeting
In a multi-cluster setup, most dashboard APIs can target one cluster, an explicit subset, or the whole fleet. Use the narrowest scope that answers the question.
| Scope | How to target |
|---|---|
| One named cluster | X-Scaleops-Cluster: <cluster-name> |
| Several named clusters | Request body clusters with multiCluster: true, or pipe-separate names in X-Scaleops-Cluster |
| All clusters | X-Scaleops-Cluster: "*" (or omit clusters while setting multiCluster: true) |
| Current (parent) cluster | Omit the header and leave multiCluster unset / false |
When both are set, the request-body clusters list takes precedence over X-Scaleops-Cluster. multiCluster must be true for a body clusters subset to fan out — otherwise the subset is ignored.
Examples
All Clusters — Cost Report
Use X-Scaleops-Cluster: "*" to fan out across all clusters:
curl -X POST "https://<DASHBOARD_URL>/detailedCostReport/getWorkloads?range=3d" \
-H "Authorization: Bearer <API_KEY>" \
-H 'X-Scaleops-Cluster: "*"' \
-H "Content-Type: application/json" \
-d '{"namespaces":["jenkins"],"workloadTypes":["Deployment"]}'Specific Cluster — Cost Report
Target a single cluster with the X-Scaleops-Cluster header:
curl -X POST "https://<DASHBOARD_URL>/detailedCostReport/getWorkloads?range=3d" \
-H "Authorization: Bearer <API_KEY>" \
-H "X-Scaleops-Cluster: <CLUSTER_NAME>" \
-H "Content-Type: application/json" \
-d '{"namespaces":["jenkins"]}'Multiple Specific Clusters — Request Body
Pass an explicit subset with multiCluster: true and clusters:
curl -X POST "https://<DASHBOARD_URL>/detailedCostReport/getWorkloads?range=3d" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"multiCluster":true,"clusters":["cluster-name1","cluster-name2"],"namespaces":["jenkins"]}'Multiple Specific Clusters — Header
Pipe-separate cluster names in the header:
curl -X POST "https://<DASHBOARD_URL>/detailedCostReport/getWorkloads?range=3d" \
-H "Authorization: Bearer <API_KEY>" \
-H "X-Scaleops-Cluster: cluster-name1|cluster-name2" \
-H "Content-Type: application/json" \
-d '{"namespaces":["jenkins"]}'