API REFERENCE

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/namespaces

Returns a paginated list of namespaces across your organization, with aggregate cost and resource totals.

Query Parameters

ParameterTypeDefaultDescription
cluster_idstringFilter by cluster ID
teamstringFilter by team label
departmentstringFilter by department label
limitinteger100Number of results to return (1 to 500)
offsetinteger0Number 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}/details

Returns detailed information for a specific namespace, including the workloads running in it.

Path Parameters

ParameterTypeRequiredDescription
namespace_namestringYesKubernetes namespace name

Query Parameters

ParameterTypeDefaultDescription
cluster_idstringRequired. 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 } ] }
text
GET /v1/namespaces/{namespace_name}/trends

Returns time-series CPU, memory, and cost data for a namespace over a given timeframe.

Path Parameters

ParameterTypeRequiredDescription
namespace_namestringYesKubernetes namespace name

Query Parameters

ParameterTypeDefaultDescription
cluster_idstringRequired. The cluster to query
timeframestring7dTime 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 } ] }