---
title: "Create a relationship definition in the registry"
method: PUT
path: "/sources/{sourceKey}/v1/relationship-definitions/{relationshipDefinitionKey}"
tags: ["Relationship Definitions"]
---

# Create a relationship definition in the registry

`PUT /sources/{sourceKey}/v1/relationship-definitions/{relationshipDefinitionKey}`

Create a relationship definition in the registry.

## Path parameters

- `sourceKey` string, required
- `relationshipDefinitionKey` string, required

## Request body

- object
  - `from` V1RelationshipRefDefinition, required
    - `profileKey` string, required
    - `includeKey` string, required
    - `includeCardinality` '0:*' | '0:1', required
  - `to` V1RelationshipRefDefinition, required
    - `profileKey` string, required
    - `includeKey` string, required
    - `includeCardinality` '0:*' | '0:1', required
  - `description` string — Description of the relationship definition.
  - `properties` object

## Response `201`

A successful response when the relationship definition was created.

- V1RelationshipDefinition
  - `key` string
  - `from` V1RelationshipRefDefinition, required
    - `profileKey` string, required
    - `includeKey` string, required
    - `includeCardinality` '0:*' | '0:1', required
  - `to` V1RelationshipRefDefinition, required
    - `profileKey` string, required
    - `includeKey` string, required
    - `includeCardinality` '0:*' | '0:1', required
  - `description` string — Description of the relationship definition.
  - `properties` object, required

## Other responses

- `400` — Returned when the request is malformed or invalid.
- `404` — Returned when a vocabulary used in a property binding does not exist.
- `413` — Returned when the payload exceeds the max content size (100kB).
- `501` — Returned when the relationship definition already exists since updating a relationship definition is not implemented yet.

---

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