Entities
queryEntityGraph
Changed onTraverse an entity relationship graph starting from a seed entity.
Define the shape of the graph using nodes (entity schemas) and edges (relationships with cardinality). The API will traverse the graph bidirectionally and return all discovered entity IDs.
Example: Find all entities connected to a contact through portal_user -> contact -> billing_account -> files
post/v1/entity:graph
Request
- Base URLhttps://entity.sls.epilot.io
- URLhttps://entity.sls.epilot.io/v1/entity:graph
- Auth
- HTTP bearer
- or API key in header x-epilot-org-id
Request body
Example request
{
"seed": {
"node_id": "contact"
},
"graph": {
"nodes": [
{
"id": "portal_user",
"schema": "portal_user",
"cardinality": "one"
},
{
"id": "contact",
"schema": "contact",
"cardinality": "one"
},
{
"id": "billing_accounts",
"schema": "billing_account",
"cardinality": "many"
}
],
"edges": [
{
"from": "portal_user",
"to": "contact"
},
{
"from": "contact",
"to": "billing_accounts"
}
]
}
}Response
Graph traversal result
Example response
{
"nodes": {
"portal_user": [
"550e8400-e29b-41d4-a716-446655440001"
],
"contact": [
"550e8400-e29b-41d4-a716-446655440002"
],
"billing_accounts": [
"550e8400-e29b-41d4-a716-446655440003",
"550e8400-e29b-41d4-a716-446655440004"
]
},
"entityNodes": {
"portal_user": {
"_id": "550e8400-e29b-41d4-a716-446655440001",
"_schema": "portal_user"
},
"contact": {
"_id": "550e8400-e29b-41d4-a716-446655440002",
"_schema": "contact"
},
"billing_accounts": [
{
"_id": "550e8400-e29b-41d4-a716-446655440003",
"_schema": "billing_account"
},
{
"_id": "550e8400-e29b-41d4-a716-446655440004",
"_schema": "billing_account"
}
]
},
"edges": [
{
"from": "portal_user",
"to": "contact"
},
{
"from": "contact",
"to": "billing_accounts"
}
]
}Changes
- info
added the new optional request property
///
- info