Skip to content

Connections

Endpoints


Match Rules Reference

The match_rules object controls how connections are resolved. Different connection types accept different fields:

CROSS_REPO_CALLS (URL Path Matching)

FieldTypeDefaultDescription
strip_base_urlbooleanfalseRemove base URL from client calls before matching
ignore_query_paramsbooleanfalseIgnore query parameters when matching paths
path_prefixstringOnly match routes starting with this prefix (e.g., /api/v2)

CROSS_REPO_MIRRORS (Type Matching)

No additional fields. Uses exact name matching on exported Class, Interface, and type-alias symbols.

CROSS_REPO_DEPENDS (Package Dependency Matching)

FieldTypeDefaultDescription
package_namestringOverride the package name to match against (otherwise read from manifest)

CROSS_REPO_IMPORTS (Direct Import Resolution)

FieldTypeDefaultDescription
path_mappingobjectMap import paths to target repo paths (e.g., {"@shared/": "src/"})

POST /api/v1/projects/{projectId}/connections

Create a cross-repo connection rule

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Request Body

FieldTypeRequiredDescription
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
connection_type"CROSS_REPO_CALLS" | "CROSS_REPO_IMPORTS" | "CROSS_REPO_DEPENDS" | "CROSS_REPO_MIRRORS"Yes
match_rulesobjectNoDefault: {}

Response (201)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
connection_typestringYes
match_rulesobjectYes
created_atstringYes
updated_atstringYes
last_resolved_atstring,nullYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found
409Connection rule already exists

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "connection_type": "CROSS_REPO_CALLS",
  "match_rules": {}
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "connection_type": "string",
  "match_rules": {},
  "created_at": "string",
  "updated_at": "string",
  "last_resolved_at": null
}

GET /api/v1/projects/{projectId}/connections

List cross-repo connection rules

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Response (200)

FieldTypeRequiredDescription
connectionsobject[]Yes

Error Responses

StatusDescription
401Unauthorized
403Forbidden

Example

Request:

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

Response:

json
{
  "connections": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "connection_type": "string",
      "match_rules": {},
      "created_at": "string",
      "updated_at": "string",
      "last_resolved_at": null
    }
  ]
}

GET /api/v1/projects/{projectId}/connections/{connId}

Get connection rule details with resolved edge count

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
connIdstring

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
connection_typestringYes
match_rulesobjectYes
created_atstringYes
updated_atstringYes
last_resolved_atstring,nullYes
edge_countnumberYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Connection rule not found

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/$CONN_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "connection_type": "string",
  "match_rules": {},
  "created_at": "string",
  "updated_at": "string",
  "last_resolved_at": null,
  "edge_count": 1
}

PATCH /api/v1/projects/{projectId}/connections/{connId}

Update a connection rule

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
connIdstring

Request Body

FieldTypeRequiredDescription
connection_type"CROSS_REPO_CALLS" | "CROSS_REPO_IMPORTS" | "CROSS_REPO_DEPENDS" | "CROSS_REPO_MIRRORS"No
match_rulesobjectNo

Response (200)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
connection_typestringYes
match_rulesobjectYes
created_atstringYes
updated_atstringYes
last_resolved_atstring,nullYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Connection rule not found

Example

Request:

bash
curl -s \
  -X PATCH \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/$CONN_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "connection_type": "CROSS_REPO_CALLS",
  "match_rules": {}
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "connection_type": "string",
  "match_rules": {},
  "created_at": "string",
  "updated_at": "string",
  "last_resolved_at": null
}

DELETE /api/v1/projects/{projectId}/connections/{connId}

Delete a connection rule and its resolved edges

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
connIdstring

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Connection rule not found

Example

Request:

bash
curl -s \
  -X DELETE \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/$CONN_ID" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

POST /api/v1/projects/{projectId}/connections/{connId}/resolve

Trigger resolution for a connection (URL matching, type matching, etc.)

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
connIdstring

Response (200)

FieldTypeRequiredDescription
connection_idstringYesFormat: uuid
edges_creatednumberYes
strategystringYes
detailsobjectYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Connection rule not found
422Resolution failed (repos not indexed)

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/$CONN_ID/resolve" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "connection_id": "550e8400-e29b-41d4-a716-446655440000",
  "edges_created": 1,
  "strategy": "string",
  "details": {}
}

GET /api/v1/projects/{projectId}/connections/{connId}/edges

List resolved cross-repo edges for a connection

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
connIdstring

Query Parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo50
offsetinteger,nullNo0

Response (200)

FieldTypeRequiredDescription
edgesobject[]Yes
totalnumberYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Connection rule not found

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/$CONN_ID/edges?limit=50&offset=0" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "edges": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
      "source_node": "UserService.getUser",
      "target_node": "UserAPI.fetchUser",
      "edge_type": "CROSS_REPO_CALLS",
      "metadata": null,
      "created_at": "string"
    }
  ],
  "total": 1
}

POST /api/v1/projects/{projectId}/connections/manual-edge

Create a manual cross-repo edge

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring

Request Body

FieldTypeRequiredDescription
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
source_nodestringYesMin length: 1. Max length: 500
target_nodestringYesMin length: 1. Max length: 500
edge_typestringYesMin length: 1. Max length: 100
metadataobject,nullNoDefault: null

Response (201)

FieldTypeRequiredDescription
idstringYesFormat: uuid
project_idstringYesFormat: uuid
source_repo_idstringYesFormat: uuid
target_repo_idstringYesFormat: uuid
source_nodestringYes
target_nodestringYes
edge_typestringYes
metadataobject,nullYes
created_atstringYes
manualbooleanYes

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found in project

Example

Request:

bash
curl -s \
  -X POST \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/manual-edge" \
  -H "Authorization: Bearer $NEXGRAPH_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_node": "UserService.getUser",
  "target_node": "UserAPI.fetchUser",
  "edge_type": "CROSS_REPO_CALLS",
  "metadata": null
}'

Response:

json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "target_repo_id": "550e8400-e29b-41d4-a716-446655440000",
  "source_node": "UserService.getUser",
  "target_node": "UserAPI.fetchUser",
  "edge_type": "CROSS_REPO_CALLS",
  "metadata": null,
  "created_at": "string",
  "manual": true
}

DELETE /api/v1/projects/{projectId}/connections/manual-edge/{id}

Delete a manual cross-repo edge

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
projectIdstring
idstring

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Manual edge not found

Example

Request:

bash
curl -s \
  -X DELETE \
  "http://localhost:3000/api/v1/projects/$PROJECT_ID/connections/manual-edge/<id>" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Released under the MIT License.