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:
| Parameter | Type | Default | Range | Description |
|---|---|---|---|---|
limit | integer | 100 | 1 to 500 | Number of records to return |
offset | integer | 0 | 0+ | 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.
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:
| Parameter | Type | Description |
|---|---|---|
cluster_id | string | Filter results to a specific cluster |
namespace | string | Filter by Kubernetes namespace |
kind | string | Filter by workload kind (e.g., Deployment, StatefulSet) |
team | string | Filter by team label (namespaces and costs endpoints) |
department | string | Filter by department label (namespaces and costs endpoints) |
storage_class | string | Filter by storage class (persistent-volumes endpoint only) |
recommendation_type | string | Filter by recommendation type (recommendations endpoint only) |
status | string | Filter 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.
| Value | Description |
|---|---|
1h | Last 1 hour |
24h | Last 24 hours |
7d | Last 7 days |
30d | Last 30 days |
90d | Last 90 days |
360d | Last 360 days |
The default varies by endpoint and is noted in each endpoint's documentation. Passing an invalid value returns 400 Bad Request.
curl -H "Authorization: Bearer ka_xxx" \
"https://public-api.kubeadapt.io/v1/clusters/cls-abc123/cost-distribution?timeframe=30d"Related
- REST API Overview - Base URL, versioning, and request format
- Error Handling - Error responses for invalid parameters