Skip to main content
Endpoints for retrieving and manipulating the code graph.

Get Graph

Retrieve all nodes and edges with their attributes.
GET
/api/graph
Returns the complete graph structure.

Response

{
  "nodes": [
    {
      "id": "MyApp.Services.UserService",
      "name": "UserService",
      "type": "Class",
      "fullName": "MyApp.Services.UserService",
      "filePath": "/src/Services/UserService.cs",
      "namespace": "MyApp.Services",
      "visibility": "Public",
      "isAbstract": false,
      "layout:x": 123.45,
      "layout:y": 67.89,
      "layout:z": 0
    }
  ],
  "edges": [
    {
      "source": "MyApp.Services.UserService",
      "target": "MyApp.Data.UserRepository",
      "type": "DEPENDS_ON"
    }
  ]
}

Example

curl http://localhost:5050/api/graph

Get Node

Retrieve a single node by ID.
GET
/api/graph/nodes/{nodeId}
Returns a single node with all attributes.

Path Parameters

ParameterTypeDescription
nodeIdstringThe node’s unique identifier

Response

{
  "id": "MyApp.Services.UserService",
  "name": "UserService",
  "type": "Class",
  "fullName": "MyApp.Services.UserService",
  "filePath": "/src/Services/UserService.cs",
  "namespace": "MyApp.Services",
  "visibility": "Public",
  "layout:x": 123.45,
  "layout:y": 67.89,
  "layout:z": 0,
  "git:churn": 45,
  "coverage:percent": 85.5
}

Example

curl http://localhost:5050/api/graph/nodes/MyApp.Services.UserService

Save Layout

Save node positions to the database.
POST
/api/graph/layout
Persists layout positions for all nodes.

Request Body

{
  "positions": {
    "MyApp.Services.UserService": [123.45, 67.89, 0],
    "MyApp.Data.UserRepository": [234.56, 78.90, 0]
  }
}

Response

{
  "success": true,
  "updated": 156
}

Example

curl -X POST http://localhost:5050/api/graph/layout \
  -H "Content-Type: application/json" \
  -d '{
    "positions": {
      "node1": [100, 200, 0],
      "node2": [150, 250, 0]
    }
  }'

Clear Layout

Remove all layout positions from nodes.
DELETE
/api/graph/layout
Clears all layout: prefixed attributes.

Response

{
  "success": true,
  "cleared": 156
}

Example

curl -X DELETE http://localhost:5050/api/graph/layout

Get Layout Status

Check how many nodes have layout positions.
GET
/api/graph/layout/status
Returns layout statistics.

Response

{
  "totalNodes": 1081,
  "nodesWithLayout": 1081,
  "nodesWithoutLayout": 0,
  "complete": true
}

Example

curl http://localhost:5050/api/graph/layout/status

Node Attributes

Nodes contain both core attributes and overlay-specific attributes:

Core Attributes

AttributeTypeDescription
idstringUnique identifier
namestringEntity name
typestringNode type (Class, Interface, etc.)
fullNamestringFully qualified name
filePathstringSource file path
namespacestringContaining namespace
visibilitystringAccess modifier
isAbstractbooleanWhether abstract
isStaticbooleanWhether static

Layout Attributes

AttributeTypeDescription
layout:xnumberX position
layout:ynumberY position
layout:znumberZ position

Overlay Attributes

Attributes prefixed with the overlay name:
PrefixExampleDescription
git:git:churnGit activity data
coverage:coverage:percentTest coverage data
complexity:complexity:cyclomaticComplexity metrics

Edge Types

TypeDescription
CONTAINSNamespace contains entity
DEPENDS_ONUses/references
INHERITSClass inheritance
IMPLEMENTSInterface implementation
CALLSMethod invocation