POST
/
v1
/
tenants
/
{tenant_id}
/
data
/
relationships
/
read
rr, err := client.Data.ReadRelationships(context.Background(), &v1.Data.RelationshipReadRequest{
    TenantId: "t1",
    Metadata: &v1.Data.RelationshipReadRequestMetadata{
        SnapToken: ""
    },
    Filter: &v1.TupleFilter{
        Entity: &v1.EntityFilter{
            Type: "organization",
            Ids: []string{"1"},
        },
        Relation: "member",
        Subject: &v1.SubjectFilter{
            Type: "",
            Id: []string{""},
            Relation: ""
        }
    }
})
{
  "tuples": [
    {
      "entity": {
        "type": "<string>",
        "id": "<string>"
      },
      "relation": "<string>",
      "subject": {
        "type": "<string>",
        "id": "<string>",
        "relation": "<string>"
      }
    }
  ],
  "continuous_token": "<string>"
}

Read API allows for directly querying the stored graph data to display and filter stored relational tuples.

Path Parameters

tenant_id
string
required

Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant <code>t1</code> for this field. Required, and must match the pattern \“[a-zA-Z0-9-,]+\“, max 64 bytes.

Body

application/json

RelationshipReadRequest defines the structure of a request for reading relationships. It contains the necessary information such as tenant_id, metadata, and filter for the read operation.

metadata
object

RelationshipReadRequestMetadata defines the structure of the metadata for a read request focused on relationships. It includes the snap_token associated with a particular state of the database.

filter
object

TupleFilter is used to filter tuples based on the entity, relation and the subject.

page_size
integer

page_size specifies the number of results to return in a single page. If more results are available, a continuous_token is included in the response.

continuous_token
string

continuous_token is used in case of paginated reads to get the next page of results.

Response

200
application/json
A successful response.

RelationshipReadResponse defines the structure of the response after reading relationships. It includes the tuples representing the relationships and a continuous token for handling result pagination.

tuples
object[]

tuples is a list of the relationships retrieved in the read operation, represented as entity-relation-entity triples.

Tuple is a structure that includes an entity, a relation, and a subject.

continuous_token
string

continuous_token is used in the case of paginated reads to retrieve the next page of results.