---
title: "Query relation tuples"
method: GET
path: "/relation-tuples"
tags: ["read"]
---

# Query relation tuples

`GET /relation-tuples`

Get all relation tuples that match the query. Only the namespace field is required.

## Query parameters

- `page_token` string
- `page_size` integer
- `namespace` string
- `object` string
- `relation` string
- `subject_id` string
- `subject_set.namespace` string
- `subject_set.object` string
- `subject_set.relation` string

## Response `200`

getRelationTuplesResponse

- GetRelationTuplesResponse
  - `next_page_token` string — The opaque token to provide in a subsequent request to get the next page. It is the empty string iff this is the last page.
  - `relation_tuples` RelationTuple[]
    - `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

- `404` — genericError
- `500` — genericError

## Changes

- **2022-02-09** `a88adf308b2b` — 3 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `404`
  - added the media type `application/json` for the response with the status `500`
- **2021-12-13** `2f265b90b524` — 1 info
  - the `query` request parameter `namespace` became optional
- **2021-10-08** `1c94c69d40e2` — 2 info
  - the `query` request parameter `object` became optional
  - the `query` request parameter `relation` became optional
- **2021-10-07** `e90046dbd055` — 5 breaking, 4 info
  - the `query` request parameter `namespace` became required
  - the `query` request parameter `object` became required
  - the `query` request parameter `relation` became required
  - removed the media type `application/json` for the response with the status `200`
  - …5 more

[Change history](https://skmtc.dev/ory/apis/ory-keto-api/changes/relation-tuples/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/514d0665dbdb/schema)
