Skip to content

Files

Endpoints


GET /api/v1/repositories/{repoId}/files

Browse the file tree of a repository

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
repoIdstring

Query Parameters

ParameterTypeRequiredDefaultDescription
pathstringNo
languagestringNo
flat"true" | "false"No"false"

Response (200)

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404Repository not found

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/repositories/$REPO_ID/files?path=value&language=value" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "files": [
    {
      "path": "string",
      "name": "my-project",
      "language": null,
      "type": "file"
    }
  ],
  "total": 1
}

GET /api/v1/repositories/{repoId}/files/{filePath}

Get file content and associated graph symbols

This endpoint uses a wildcard path parameter and is not part of the OpenAPI spec. It retrieves the raw source code of a file along with all symbols (functions, classes, etc.) defined in it.

Authentication

Requires Bearer token. See Authentication.

Path Parameters

ParameterTypeDescription
repoIdstring (UUID)Repository ID
filePathstringFull file path within the repository (e.g., src/index.ts)

Response (200)

FieldTypeDescription
pathstringFile path
languagestring | nullDetected language
contentstringRaw file content
line_countnumberNumber of lines
symbolsarrayGraph symbols defined in this file
symbols[].idnumber | stringGraph node ID
symbols[].labelstringNode label (Function, Class, Interface, etc.)
symbols[].propertiesobjectNode properties (name, signature, exported, etc.)

Error Responses

StatusDescription
401Unauthorized
403Forbidden
404File or repository not found

Example

Request:

bash
curl -s \
  "http://localhost:3000/api/v1/repositories/$REPO_ID/files/src/index.ts" \
  -H "Authorization: Bearer $NEXGRAPH_KEY"

Response:

json
{
  "path": "src/index.ts",
  "language": "typescript",
  "content": "import { serve } from \"@hono/node-server\";\n...",
  "line_count": 42,
  "symbols": [
    {
      "id": 12345,
      "label": "Function",
      "properties": {
        "name": "startServer",
        "signature": "function startServer(): void",
        "exported": true,
        "async": true,
        "file_path": "src/index.ts",
        "start_line": 10,
        "end_line": 25
      }
    }
  ]
}

Released under the MIT License.