Skip to content

Cross-Repo Graph

Endpoints


POST /api/v1/projects/{projectId}/graph/cross-repo/trace

Trace end-to-end flows across connected repositories

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Request Body

FieldTypeRequiredDescription
start_repo_idstringYesFormat: uuid
start_symbolstringYesMin length: 1. Max length: 500
direction"forward" | "backward" | "both"NoDefault: "forward"
max_depthintegerNoDefault: 3. Min: 1. Max: 10

Response (200)

FieldTypeRequiredDescription
startobjectYes
nodesobject[]Yes
edgesobject[]Yes
depth_reachednumberYes
repos_traversedstring[]Yes

Error Responses

StatusDescription
400Invalid request
401Unauthorized
403Forbidden
404Repository, graph, or symbol not found

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/graph/cross-repo/trace" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "start_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "start_symbol": "handleRequest",
  "direction": "forward",
  "max_depth": 3
}'

Response:

json
{
  "start": {
    "repo_id": "550e8400-e29b-41d4-a716-446655440000",
    "symbol_name": "string",
    "label": "ci-read-only",
    "file_path": "src/index.ts",
    "properties": {}
  },
  "nodes": [
    {
      "repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "symbol_name": "string",
      "label": "ci-read-only",
      "file_path": "src/index.ts",
      "properties": {}
    }
  ],
  "edges": [
    {
      "from_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "from_symbol": "string",
      "to_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "to_symbol": "string",
      "edge_type": "CROSS_REPO_CALLS",
      "cross_repo": true,
      "metadata": null
    }
  ],
  "depth_reached": 1,
  "repos_traversed": [
    "550e8400-e29b-41d4-a716-446655440000"
  ]
}

POST /api/v1/projects/{projectId}/graph/cross-repo/impact

Analyze blast radius across connected repositories

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Request Body

FieldTypeRequiredDescription
repo_idstringYesFormat: uuid
symbolstringYesMin length: 1. Max length: 500
depthintegerNoDefault: 3. Min: 1. Max: 10

Response (200)

FieldTypeRequiredDescription
rootobjectYes
affectedobject[]Yes
summaryobjectYes

Error Responses

StatusDescription
400Invalid request
401Unauthorized
403Forbidden
404Repository, graph, or symbol not found

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/graph/cross-repo/impact" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "symbol": "handleRequest",
  "depth": 3
}'

Response:

json
{
  "root": {
    "repo_id": "550e8400-e29b-41d4-a716-446655440000",
    "symbol_name": "string",
    "label": "ci-read-only",
    "file_path": "src/index.ts",
    "is_cross_repo": true,
    "properties": {}
  },
  "affected": [
    {
      "repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "symbol_name": "string",
      "label": "ci-read-only",
      "file_path": "src/index.ts",
      "is_cross_repo": true,
      "properties": {}
    }
  ],
  "summary": {
    "total_affected": 1,
    "repos_affected": 1,
    "by_repo": {},
    "by_edge_type": {}
  }
}

GET /api/v1/projects/{projectId}/graph/cross-repo/stats

Get cross-repo connection statistics

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Response (200)

FieldTypeRequiredDescription
total_edgesnumberYes
total_connectionsnumberYes
by_edge_typeobjectYes
by_repo_pairobject[]Yes
repos_involvednumberYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/graph/cross-repo/stats" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "total_edges": 1,
  "total_connections": 1,
  "by_edge_type": {},
  "by_repo_pair": [
    {
      "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "edge_count": 1
    }
  ],
  "repos_involved": 1
}

Released under the MIT License.