---
title: "Upsert relationship"
method: PUT
path: "/v1/workspaces/{workspaceId}/relationship-rules/{relationshipRuleId}"
---

# Upsert relationship

`PUT /v1/workspaces/{workspaceId}/relationship-rules/{relationshipRuleId}`

## Path parameters

- `workspaceId` string, required
- `relationshipRuleId` string, required

## Request body

- UpsertRelationshipRuleRequest
  - `cel` string, required
  - `description` string
  - `metadata` object, required
  - `name` string, required
  - `reference` string, required

## Response `202`

Accepted response

- RelationshipRule
  - `cel` string, required
  - `description` string
  - `id` string, required
  - `metadata` object, required
  - `name` string, required
  - `reference` string, required
  - `workspaceId` string, required

## Other responses

- `400` — Invalid request
- `404` — Resource not found

## Changes

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

- **2026-03-10** `4507a7cb420a` — 5 breaking, 8 warning, 1 info
  - added the new required request property `cel`
  - removed the required property `fromType` from the response with the `202` status
  - removed the required property `matcher` from the response with the `202` status
  - removed the required property `relationshipType` from the response with the `202` status
  - …10 more
- **2026-02-19** `e61389fc98ac` — 5 breaking, 1 warning, 8 info
  - added the new required request property `fromType`
  - added the new required request property `matcher`
  - added the new required request property `relationshipType`
  - added the new required request property `toType`
  - …10 more

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/relationship-rules/:relationshipRuleId/put.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/156e0d264995/schema)
