Skip to content

Traversal API

Terminal window
GET /graphs/{graphId}/traverse
ParameterTypeRequiredDefaultDescription
sourceIdstringyes—Starting node ID
depthnumberno2Max traversal depth (1–5)
directionstringnooutboundoutbound / inbound / both
edgeTypestringnoallFilter edges by type
Terminal window
GET /graphs/grph_01j9abc/traverse?sourceId=node_alice&depth=3&direction=both
{
"source": {
"id": "node_alice",
"type": "Person",
"data": { "name": "Alice" }
},
"nodes": [
{ "id": "node_bob", "type": "Person", "data": { "name": "Bob" }, "depth": 1 },
{ "id": "node_acme", "type": "Company", "data": { "name": "Acme" }, "depth": 2 }
],
"edges": [
{ "id": "e1", "type": "KNOWS", "sourceId": "node_alice", "targetId": "node_bob" },
{ "id": "e2", "type": "WORKS_AT", "sourceId": "node_bob", "targetId": "node_acme" }
],
"visitedCount": 3,
"depthReached": 2,
"truncated": false
}
  • truncated: true means the traversal hit the maxVisited limit (1000 nodes) before reaching the requested depth.