Skip to main content

List Repositories

Fetch all GitHub repositories the authenticated user has access to, annotated with connection status.
curl -X GET 'http://localhost:8000/api/v1/repos' \
  --cookie 'access_token=<your_jwt>'
Method: GET /api/v1/repos Authentication: Required

Response

Array of repository objects:
id
integer
required
GitHub repository ID
name
string
required
Repository name (e.g., "nectr")
full_name
string
required
Full repository name (e.g., "octocat/nectr")
description
string
Repository description
private
boolean
required
Whether the repository is private
html_url
string
required
GitHub repository URL
updated_at
string
ISO 8601 timestamp of last update
is_connected
boolean
required
Whether Nectr is connected to this repository
installation_id
integer
Internal installation ID (null if not connected)

Example Response

[
  {
    "id": 123456789,
    "name": "nectr",
    "full_name": "octocat/nectr",
    "description": "AI-powered code review assistant",
    "private": false,
    "html_url": "https://github.com/octocat/nectr",
    "updated_at": "2025-03-10T12:30:00Z",
    "is_connected": true,
    "installation_id": 7
  }
]

Error Responses

  • 401: Token decryption failed (SECRET_KEY changed)
  • 502: Failed to fetch repositories from GitHub

Connect Repository

Connect a repository to Nectr in one click (no GitHub redirect required).
curl -X POST 'http://localhost:8000/api/v1/repos/octocat/nectr/install' \
  --cookie 'access_token=<your_jwt>'
Method: POST /api/v1/repos/{owner}/{repo}/install Authentication: Required
owner
string
required
Repository owner (user or organization)
repo
string
required
Repository name

What This Does

  1. Creates a webhook on the GitHub repository pointing to {BACKEND_URL}/api/v1/webhooks/github
  2. Stores installation record with webhook ID and secret
  3. Kicks off background tasks:
    • Project scan: Extracts architecture and conventions using AI
    • Graph build: Indexes file tree into Neo4j

Response

status
string
required
Always "connected"
installation_id
integer
required
Internal installation ID
repo
string
required
Full repository name (e.g., "octocat/nectr")

Example Response

{
  "status": "connected",
  "installation_id": 7,
  "repo": "octocat/nectr"
}

Error Responses

  • 400: Repo already connected
  • 401: Session expired
  • 502: Failed to install webhook (check GitHub permissions)

Rescan Repository

Re-index the repository file tree into Neo4j.
curl -X POST 'http://localhost:8000/api/v1/repos/octocat/nectr/rescan' \
  --cookie 'access_token=<your_jwt>'
Method: POST /api/v1/repos/{owner}/{repo}/rescan Authentication: Required
owner
string
required
Repository owner
repo
string
required
Repository name

Response

status
string
required
Always "scan_complete"
repo
string
required
Full repository name
files_indexed
integer
required
Number of files indexed into Neo4j

Example Response

{
  "status": "scan_complete",
  "repo": "octocat/nectr",
  "files_indexed": 247
}

Error Responses

  • 404: Repo not connected
  • 503: Neo4j not configured
  • 500: Rescan failed

Disconnect Repository

Disconnect a repository and remove its webhook.
curl -X DELETE 'http://localhost:8000/api/v1/repos/octocat/nectr/install' \
  --cookie 'access_token=<your_jwt>'
Method: DELETE /api/v1/repos/{owner}/{repo}/install Authentication: Required
owner
string
required
Repository owner
repo
string
required
Repository name

Response

status
string
required
Always "disconnected"
repo
string
required
Full repository name

Example Response

{
  "status": "disconnected",
  "repo": "octocat/nectr"
}

Notes

  • Marks installation as inactive in database
  • Attempts to remove webhook from GitHub (warns if fails)
  • Does not delete Neo4j graph data or memory records

Error Responses

  • 404: Installation not found

Build docs developers (and LLMs) love