---
title: "Expand a Relationship into permissions."
method: GET
path: "/relation-tuples/expand"
tags: ["permission"]
---

# Expand a Relationship into permissions.

`GET /relation-tuples/expand`

Use this endpoint to expand a relationship tuple into permissions.

## Query parameters

- `namespace` string, required
- `object` string, required
- `relation` string, required
- `max-depth` integer

## Response `200`

expandedPermissionTree

- ExpandedPermissionTree
  - `children` ExpandedPermissionTree[] — The children of the node, possibly none.
  - `tuple` 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
  - `type` 'union' | 'exclusion' | 'intersection' | 'leaf' | 'tuple_to_subject_set' | 'computed_subject_set' | 'not' | 'unspecified', required — The type of the node. union TreeNodeUnion exclusion TreeNodeExclusion intersection TreeNodeIntersection leaf TreeNodeLeaf tuple_to_subject_set TreeNodeTupleToSubjectSet computed_subject_set TreeNodeComputedSubjectSet not TreeNodeNot unspecified TreeNodeUnspecified

## Other responses

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

## Changes

- **2022-11-25** `5f207fe3fcc0` — 12 warning, 6 info
  - removed the optional property `code` from the response with the `400` status
  - removed the optional property `code` from the response with the `404` status
  - removed the optional property `details` from the response with the `400` status
  - removed the optional property `details` from the response with the `404` status
  - …14 more
- **2022-08-19** `f018d2492c97` — 5 warning, 1 info
  - removed the optional property `subject_id` from the response with the `200` status
  - removed the optional property `subject_set` from the response with the `200` status
  - added the new `computed_subject_set` enum value to the `type` response property for the response status `200`
  - added the new `not` enum value to the `type` response property for the response status `200`
  - …2 more
- **2022-07-27** `514d0665dbdb` — 1 warning
  - added the new `unspecified` enum value to the `type` response property for the response status `200`
- **2022-03-29** `770289c14605` — 1 info
  - endpoint added
- **2021-10-07** `e90046dbd055` — 1 breaking
  - api path removed without deprecation

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

---

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