---
title: "Get relationship rules for a given workspace"
method: GET
path: "/v1/workspaces/{workspaceId}/relationship-rules"
---

# Get relationship rules for a given workspace

`GET /v1/workspaces/{workspaceId}/relationship-rules`

Returns all relationship rules for the specified workspace.

## Path parameters

- `workspaceId` string, required

## Query parameters

- `offset` integer
- `limit` integer

## Response `200`

Paginated list of items

- object
  - `items` RelationshipRule[], required
    - `description` string
    - `fromSelector` union
      - JsonSelector
        - `json` object, required
      - CelSelector
        - `cel` string, required
    - `fromType` 'deployment' | 'environment' | 'resource', required
    - `id` string, required
    - `matcher` CelMatcher, required
      - `cel` string, required
    - `metadata` object, required
    - `name` string, required
    - `reference` string, required
    - `relationshipType` string, required
    - `toSelector` union
      - JsonSelector
        - `json` object, required
      - CelSelector
        - `cel` string, required
    - `toType` 'deployment' | 'environment' | 'resource', 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
- `404` — Resource not found

## Changes

- **2026-02-19** `e61389fc98ac` — 1 breaking, 6 info
  - removed the required property `items/items/cel` from the response with the `200` status
  - added the optional property `items/items/fromSelector` to the response with the `200` status
  - added the optional property `items/items/toSelector` to the response with the `200` status
  - added the required property `items/items/fromType` to the response with the `200` status
  - …3 more

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/relationship-rules/get.md)

---

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