Traversal API
Endpoint
Section titled “Endpoint”GET /graphs/{graphId}/traverseParameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sourceId | string | yes | — | Starting node ID |
depth | number | no | 2 | Max traversal depth (1–5) |
direction | string | no | outbound | outbound / inbound / both |
edgeType | string | no | all | Filter edges by type |
Example
Section titled “Example”GET /graphs/grph_01j9abc/traverse?sourceId=node_alice&depth=3&direction=bothResponse
Section titled “Response”{ "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: truemeans the traversal hit themaxVisitedlimit (1000 nodes) before reaching the requested depth.