careful-honey-27437
05/29/2025, 5:50 AMbrief-egg-61061
05/29/2025, 5:50 AMbrief-egg-61061
05/29/2025, 5:50 AMcareful-honey-27437
05/29/2025, 5:51 AMgetRelationships
method to list all the relationships for a subject under a specific Namespace?brief-egg-61061
05/29/2025, 5:51 AMbrief-egg-61061
05/29/2025, 5:51 AMgetRelationships
method to list all relationships for a subject under a specific namespace. The API allows you to filter relationships by various parameters, including namespace
and subject_id
. By specifying both the namespace
and the subject_id
in your query, you will retrieve all relationships for that subject within the given namespace. Here’s how the relevant query parameters are described: - namespace
(string, optional): Namespace of the Relationship - subject_id
(string, optional): SubjectID of the Relationship Only the namespace
field is required, but you can combine it with subject_id
to filter the results as needed. This is supported by the REST API, which the client-fetch SDK wraps for Node.js usage: GET /relation-tuples?namespace=<namespace>&subject_id=<subject_id>
This will return all relationships for the specified subject in the given namespace [Ory API Reference – getRelationships](https://www.ory.sh/docs/reference/api) [Ory Keto REST API Reference – getRelationships](https://www.ory.sh/docs/keto/reference/rest-api). If you need a code example or further details on using the client-fetch SDK specifically, please let me know!careful-honey-27437
05/29/2025, 5:51 AMbrief-egg-61061
05/29/2025, 5:51 AMbrief-egg-61061
05/29/2025, 5:52 AMgetRelationships
method (which maps to the GET /relation-tuples
endpoint), you can pass the following query parameters: - page_token
(string, optional): For pagination, the token to retrieve the next page. - page_size
(integer, optional): The number of results per page. - namespace
(string, optional): Namespace of the relationship. - object
(string, optional): Object of the relationship. - relation
(string, optional): Relation of the relationship. - subject_id
(string, optional): SubjectID of the relationship. - subject_set.namespace
(string, optional): Namespace of the subject set. - subject_set.object
(string, optional): Object of the subject set. - subject_set.relation
(string, optional): Relation of the subject set. You can use any combination of these parameters to filter your query. Only the namespace
field is required to perform a basic query, but you can refine your search by including additional parameters as needed [Ory Keto REST API Reference – getRelationships](https://www.ory.sh/docs/keto/reference/rest-api). Here’s a summary table for clarity: | Parameter | Type | Description | |--------------------------|----------|------------------------------------| | page_token | string | Pagination token | | page_size | integer | Number of results per page | | namespace | string | Namespace of the relationship | | object | string | Object of the relationship | | relation | string | Relation of the relationship | | subject_id | string | SubjectID of the relationship | | subject_set.namespace | string | Namespace of the subject set | | subject_set.object | string | Object of the subject set | | subject_set.relation | string | Relation of the subject set |