---
title: "Compute resource aggregate"
method: POST
path: "/v1/workspaces/{workspaceId}/resources/aggregates"
---

# Compute resource aggregate

`POST /v1/workspaces/{workspaceId}/resources/aggregates`

Filters resources by a CEL expression and groups them by specified properties, returning counts per group.

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `filter` string — CEL expression to filter resources. Defaults to "true" (all resources).
  - `groupBy` object[]
    - `name` string, required — Label for this grouping
    - `property` string, required — Dot-path property to group by (e.g. kind, metadata.region)

## Response `200`

OK response

- object
  - `groups` object[], required
    - `count` integer, required — Number of resources in this group
    - `key` object, required — Map of grouping name to its value for this bucket
  - `total` integer, required — Total number of matching resources

## Other responses

- `400` — Invalid request

## Changes

> 50 revisions in range; 1 could not be searched.

- **2026-03-11** `2c1aa559b676` — 1 info
  - endpoint added
- **2026-02-11** `3924e3b154f6` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ctrlplanedev/apis/workspace-engine-api/changes/v1/workspaces/:workspaceId/resources/aggregates/post.md)

---

[API](https://skmtc.dev/ctrlplanedev/apis/workspace-engine-api.md) · [All operations](https://skmtc.dev/ctrlplanedev/apis/workspace-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ctrlplanedev/workspace-engine-api/revisions/e4a4bf1152c8/schema)
