API reference

Knowledge Graph API

Access the knowledge graph built from your repositories. Nodes represent code artifacts, PRs, issues, and docs; edges represent relationships between them.

GET/api/v1/graph/reposgraph:read

Returns the list of repository full names that have indexed knowledge graph data accessible to this API key.

Request

curl https://scopedocs-ai-production.up.railway.app/api/v1/graph/repos \
  -H "X-API-Key: sk-sd_your_key_here"

Response

JSON
{
  "repos": [
    "acme/backend",
    "acme/frontend",
    "acme/infra"
  ]
}
GET/api/v1/graph/node/{node_id}graph:read

Returns a single knowledge graph node by its ID, including the node type, metadata, and any linked generated documents.

Parameters

NameTypeRequiredDescription
node_idstringrequiredThe unique identifier of the graph node.

Request

curl https://scopedocs-ai-production.up.railway.app/api/v1/graph/node/node_abc123 \
  -H "X-API-Key: sk-sd_your_key_here"

Response

JSON
{
  "id": "node_abc123",
  "type": "function",
  "label": "authenticate_user",
  "repo_full_name": "acme/backend",
  "file_path": "backend/auth/jwt_auth.py",
  "metadata": {
    "language": "python",
    "lines": 45
  },
  "linked_docs": [
    "d1a2b3c4-e5f6-7890-abcd-ef1234567890"
  ],
  "relationships": [
    {
      "type": "calls",
      "target_id": "node_def456"
    },
    {
      "type": "referenced_by",
      "target_id": "node_ghi789"
    }
  ]
}
GET/api/v1/graph/{repo}graph:read

Returns the full knowledge graph for a repository, including all nodes and edges. Large graphs may be truncated — use pagination if supported.

Parameters

NameTypeRequiredDescription
repostringrequiredRepository full name, e.g. "acme/backend". Supports slashes in path.

Request

curl https://scopedocs-ai-production.up.railway.app/api/v1/graph/acme/backend \
  -H "X-API-Key: sk-sd_your_key_here"

Response

JSON
{
  "nodes": [
    {
      "id": "node_abc123",
      "type": "function",
      "label": "authenticate_user"
    },
    {
      "id": "node_def456",
      "type": "module",
      "label": "jwt_auth"
    }
  ],
  "edges": [
    {
      "source": "node_abc123",
      "target": "node_def456",
      "type": "belongs_to"
    }
  ]
}