API REFERENCE

Pagination and Filtering

Paginate and filter Kubeadapt API list results using limit, offset, cluster_id, namespace, team, department, and timeframe query parameters.

List endpoints return paginated results. Use query parameters to page through data and narrow results by cluster, namespace, or other dimensions.

Pagination

All list endpoints support two pagination parameters:

ParameterTypeDefaultRangeDescription
limitinteger1001 to 500Number of records to return
offsetinteger00+Number of records to skip

Every paginated response includes a total field with the count of all matching records, regardless of limit and offset. Use this to calculate how many pages exist.

bash
curl -H "Authorization: Bearer ka_xxx" \ "https://public-api.kubeadapt.io/v1/workloads?limit=10&offset=20"

To fetch all records, keep incrementing offset by limit until offset >= total.

Common Filters

Most list endpoints accept these query parameters:

ParameterTypeDescription
cluster_idstringFilter results to a specific cluster
namespacestringFilter by Kubernetes namespace
kindstringFilter by workload kind (e.g., Deployment, StatefulSet)
teamstringFilter by team label (namespaces and costs endpoints)
departmentstringFilter by department label (namespaces and costs endpoints)
storage_classstringFilter by storage class (persistent-volumes endpoint only)
recommendation_typestringFilter by recommendation type (recommendations endpoint only)
statusstringFilter by status (recommendations endpoint only)

Not every endpoint supports every filter. Each endpoint's reference page lists which filters apply.

Timeframe Parameter

Metrics endpoints accept a timeframe parameter that controls the time window for returned data points.

ValueDescription
1hLast 1 hour
24hLast 24 hours
7dLast 7 days
30dLast 30 days
90dLast 90 days
360dLast 360 days

The default varies by endpoint and is noted in each endpoint's documentation. Passing an invalid value returns 400 Bad Request.

bash
curl -H "Authorization: Bearer ka_xxx" \ "https://public-api.kubeadapt.io/v1/clusters/cls-abc123/cost-distribution?timeframe=30d"