---
title: "Create a Relationship"
method: PUT
path: "/admin/relation-tuples"
tags: ["relationship"]
---

# Create a Relationship

`PUT /admin/relation-tuples`

Use this endpoint to create a relationship.

## Request body

- CreateRelationshipBody — Create Relationship Request Body
  - `namespace` string — Namespace to query
  - `object` string — Object to query
  - `relation` string — Relation to query
  - `subject_id` string — SubjectID to query Either SubjectSet or SubjectID can be provided.
  - `subject_set` SubjectSet
    - `namespace` string, required — Namespace of the Subject Set
    - `object` string, required — Object of the Subject Set
    - `relation` string, required — Relation of the Subject Set

## Response `201`

relationship

- Relationship — Relationship
  - `namespace` string, required — Namespace of the Relation Tuple
  - `object` string, required — Object of the Relation Tuple
  - `relation` string, required — Relation of the Relation Tuple
  - `subject_id` string — SubjectID of the Relation Tuple Either SubjectSet or SubjectID can be provided.
  - `subject_set` SubjectSet
    - `namespace` string, required — Namespace of the Subject Set
    - `object` string, required — Object of the Subject Set
    - `relation` string, required — Relation of the Subject Set

## Other responses

- `400` — errorGeneric
- `default` — errorGeneric

## Changes

- **2022-11-25** `acd2fb10eb38` — 4 info
  - api operation id `createRelationTuple` removed and replaced with `createRelationship`
  - api tag `relationship` added
  - api tag `write` removed
  - removed the non-success response with the status `500`
- **2022-03-29** `5927be396871` — 1 info
  - endpoint added
- **2021-09-24** `b323fac0f51a` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ory/apis/ory-keto/changes/admin/relation-tuples/put.md)

---

[API](https://skmtc.dev/ory/apis/ory-keto.md) · [All operations](https://skmtc.dev/ory/apis/ory-keto/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ory/ory-keto/revisions/acd2fb10eb38/schema)
