Namespaces API
List Kubernetes namespaces, get namespace details, and view resource utilization trends over time. Filter by cluster, team, or department.
Namespace endpoints return cost and resource data grouped by Kubernetes namespace, with support for team and department filtering.
Required scope: namespaces:read
List Namespaces
text
GET /v1/namespacesReturns a paginated list of namespaces across your organization, with aggregate cost and resource totals.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Filter by cluster ID | |
team | string | Filter by team label | |
department | string | Filter by department label | |
limit | integer | 100 | Number of results to return (1 to 500) |
offset | integer | 0 | Number of results to skip |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/namespaces?cluster_id=cls-abc123&team=platform"Example Response
json
{
"namespaces": [
{
"name": "production",
"cluster_id": "cls-abc123",
"cluster_name": "prod-us-east",
"team": "platform",
"department": "engineering",
"workload_count": 12,
"pod_count": 48,
"total_cpu_cores": 4.2,
"total_memory_gb": 18.5,
"hourly_cost": 12.4,
"monthly_cost": 9052.0,
"efficiency_score": 0.76,
"container_count": 72
}
],
"total": 8,
"summary": {
"total_hourly_cost": 125.5,
"total_pods": 250,
"total_workloads": 42
}
}Namespace Details
text
GET /v1/namespaces/{namespace_name}/detailsReturns detailed information for a specific namespace, including the workloads running in it.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Kubernetes namespace name |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Required. The cluster to query |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/namespaces/production/details?cluster_id=cls-abc123"Example Response
json
{
"name": "production",
"cluster_id": "cls-abc123",
"cluster_name": "prod-us-east",
"team": "platform",
"department": "engineering",
"workload_count": 12,
"pod_count": 48,
"total_cpu_cores": 4.2,
"total_memory_gb": 18.5,
"hourly_cost": 12.4,
"efficiency_score": 0.76,
"monthly_cost": 9052.0,
"container_count": 72,
"workloads": [
{
"id": "wl-xyz789",
"workload_name": "api-server",
"workload_kind": "Deployment",
"replicas": 3,
"available_replicas": 3,
"cpu_request": 0.32,
"memory_request_gb": 0.38,
"hourly_cost": 0.85
}
]
}Namespace Trends
text
GET /v1/namespaces/{namespace_name}/trendsReturns time-series CPU, memory, and cost data for a namespace over a given timeframe.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
namespace_name | string | Yes | Kubernetes namespace name |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cluster_id | string | Required. The cluster to query | |
timeframe | string | 7d | Time window. Valid values: 1h, 24h, 7d, 30d, 90d, 360d |
Example Request
bash
curl -H "Authorization: Bearer ka_your_api_key" \
"https://public-api.kubeadapt.io/v1/namespaces/production/trends?cluster_id=cls-abc123&timeframe=30d"Example Response
json
{
"namespace_name": "production",
"cluster_id": "cls-abc123",
"timeframe": "30d",
"data_points": [
{
"timestamp": "2026-03-10T00:00:00Z",
"cpu_usage": 4.1,
"memory_usage_bytes": 19327352832,
"hourly_cost": 12.2
},
{
"timestamp": "2026-03-11T00:00:00Z",
"cpu_usage": 4.3,
"memory_usage_bytes": 19864649728,
"hourly_cost": 12.55
}
]
}Related
- Workloads - Workload-level metrics within namespaces
- Clusters - Cluster-level cost data
- Cost Allocation - Cost breakdown by team and department