---
title: "Query resources with CEL expression"
method: POST
path: "/v1/workspaces/{workspaceId}/resources/query"
---

# Query resources with CEL expression

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

Returns paginated resources that match the provided CEL expression. Use the "resource" variable in your expression to access resource properties.

## Path parameters

- `workspaceId` string, required

## Query parameters

- `limit` integer
- `offset` integer

## Request body

- object
  - `filter` string — CEL expression to filter resources. Defaults to "true" (all resources).

## Response `200`

Paginated list of items

- object
  - `items` Resource[], required
    - `config` object, required
    - `createdAt` string, date-time, required
    - `deletedAt` string, date-time
    - `id` string, required
    - `identifier` string, required
    - `kind` string, required
    - `lockedAt` string, date-time
    - `metadata` object, required
    - `name` string, required
    - `providerId` string
    - `updatedAt` string, date-time
    - `variables` object
    - `version` string, required
    - `workspaceId` string, required
  - `limit` integer, required — Maximum number of items returned
  - `offset` integer, required — Number of items skipped
  - `total` integer, required — Total number of items available

## Other responses

- `400` — Invalid request

## Changes

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

- **2026-04-16** `f90d884ae2a1` — 1 info
  - added the optional property `items/items/variables` to the response with the `200` status
- **2026-03-12** `fa1b98121816` — 2 breaking
  - removed `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` from the `filter` request property `oneOf` list
  - the `filter` request property type/format changed from ``/`` to `string`/``
- **2026-02-11** `3924e3b154f6` — 1 breaking, 1 warning, 1 info
  - the `filter` request property type/format changed from `string`/`` to ``/``
  - removed the optional property `items/items/variables` from the response with the `200` status
  - added `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` to the `filter` request property `oneOf` list

[Change history](https://skmtc.dev/ctrlplanedev/apis/workspace-engine-api/changes/v1/workspaces/:workspaceId/resources/query/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)
