Skip to main content
POST /v1/tenants/{tenant_id}/data/relationships/read The Read Relationships endpoint queries the stored relationship graph and returns matching tuples. Use filters to narrow results by entity type, entity IDs, relation name, and/or subject. Results are paginated.

Path Parameters

tenant_id
string
required
The tenant identifier. Use t1 for single-tenant deployments. Must match ^([a-zA-Z0-9_\-@\.:+]{1,128}|\*)$.

Request Body

metadata
object
required
filter
object
required
Criteria for selecting which tuples to return.
page_size
integer
Number of tuples to return per page. Must be >= 1.
continuous_token
string
Pagination token from a previous response. Omit for the first page.

Response

tuples
array
The list of relationship tuples matching the filter.
continuous_token
string
Pagination token for the next page. Empty when there are no more results.

Example

curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/relationships/read' \
--header 'Content-Type: application/json' \
--data-raw '{
  "metadata": {
    "snap_token": ""
  },
  "filter": {
    "entity": {
      "type": "organization",
      "ids": ["1"]
    },
    "relation": "member",
    "subject": {
      "type": "",
      "ids": [],
      "relation": ""
    }
  }
}'
Request body
{
  "metadata": {
    "snap_token": ""
  },
  "filter": {
    "entity": {
      "type": "organization",
      "ids": ["1"]
    },
    "relation": "member",
    "subject": {
      "type": "",
      "ids": [],
      "relation": ""
    }
  }
}
Response
{
  "tuples": [
    {
      "entity": { "type": "organization", "id": "1" },
      "relation": "member",
      "subject": { "type": "user", "id": "3", "relation": "" }
    },
    {
      "entity": { "type": "organization", "id": "1" },
      "relation": "member",
      "subject": { "type": "user", "id": "7", "relation": "" }
    }
  ],
  "continuous_token": ""
}

Error Codes

HTTP StatusDescription
400Bad request — invalid filter fields
401Unauthorized
404Tenant not found
429Rate limit exceeded
500Internal server error

Build docs developers (and LLMs) love