Problem Statement
While Repowise maintains dedicated reference documentation for the CLI (CLI_REFERENCE.md), configuration schema (CONFIG.md), and MCP tools (MCP_TOOLS.md) under docs/reference/, there is currently no REST API Reference document (API_REFERENCE.md).
The FastAPI backend (repowise serve) powers both the Next.js web dashboard and external HTTP clients, exposing 33 router modules under packages/server/src/repowise/server/routers/. While individual endpoints are mentioned in passing across architecture deep-dives, developers building custom integrations or querying repowise serve programmatically lack a single, authoritative API reference detailing request/response schemas, parameters, authentication, and status codes.
Undocumented Endpoint Clusters
Below is the breakdown of the 33 router modules that require OpenAPI / Markdown documentation:
1. Repository Management & Sync (routers/repos.py, routers/jobs.py)
GET /api/repos — List registered repositories
GET /api/repos/summary — Aggregate stats for all repositories in one call
POST /api/repos — Register a new repository
POST /api/repos/{id}/sync — Trigger structural graph sync (no LLM calls)
POST /api/repos/{id}/full-resync — Full regeneration of wiki pages and vector embeddings
GET /api/jobs & GET /api/jobs/{id}/stream — Background job status and live SSE progress stream
2. Workspace & Multi-Repo Architecture (routers/workspace.py, routers/coupling.py)
GET /api/workspace/system-graph — System-wide cross-repo dependency graph
GET /api/workspace/contracts & /detail — Extracted API contract links and schemas
GET /api/workspace/blast-radius — Cross-repository blast radius analysis
GET /api/workspace/breaking-changes — Incompatible cross-repo contract report
GET /api/workspace/conformance — Architectural boundary conformance report
GET /api/workspace/architecture — System score and role metrics per repo/service
GET /api/workspace/diagnostics — Workspace health and drift diagnostics
3. Refactoring & Code Health (routers/refactoring.py, routers/code_health/)
GET /api/repos/{id}/refactoring/opportunities — Ranked refactoring suggestions
GET /api/repos/{id}/refactoring/opportunities/{opportunity_id} — Detailed refactoring plan
POST /api/repos/{id}/refactoring/{suggestion_id}/generate-code — Generate refactored diff
GET/PUT /api/repos/{id}/refactoring/settings — Toggle LLM refactoring settings
GET /api/repos/{id}/health/overview — Defect, maintainability, and performance scores
GET /api/repos/{id}/health/coverage — Coverage ingestion stats and per-file test coverage
4. Architecture Visualization & C4 (routers/c4.py)
GET /api/graph/{id}/c4/l1 — L1 System Context diagram payload
GET /api/graph/{id}/c4/l2 — L2 Container diagram payload
GET /api/graph/{id}/c4/l3 — L3 Component diagram payload
GET /api/graph/{id}/c4/structurizr — Structurizr DSL export
GET /api/graph/{id}/c4/mermaid — Mermaid SVG/diagram export
5. Search, Symbols & Documentation (routers/search.py, routers/pages.py, routers/symbols.py)
GET /api/search — Hybrid search (semantic vector + FTS5/tsvector full-text)
GET /api/pages — Wiki page retrieval (supports fields=summary or fields=full)
GET /api/symbols — Symbol index and filterable call graph
6. Architectural Decisions & Episodes (routers/decisions.py, routers/episodes.py)
GET /api/repos/{id}/decisions — ADR list and candidates
GET /api/repos/{id}/decisions/lane-counts — Decision counts by lifecycle lane
GET /api/repos/{id}/episodes — Mined transcripts and decisions over HTTP
7. Codebase Chat (routers/chat.py)
POST /api/repos/{id}/chat/messages — SSE streaming agentic Q&A loop
GET/DELETE /api/repos/{id}/chat/conversations — Conversation history persistence
8. Webhooks & System Operations (routers/webhooks.py, routers/meta.py, routers/mcp.py)
POST /api/webhooks/github — GitHub push webhook (HMAC verified)
POST /api/webhooks/gitlab — GitLab push webhook
GET/PATCH /api/mcp/tools — Read/toggle active MCP tool surface per repo
GET /health & GET /metrics — Liveness/readiness probes and Prometheus metrics
Proposed Solution
- Create
docs/reference/API_REFERENCE.md structured by resource area:
- Authentication (
REPOWISE_API_KEY bearer token requirements)
- Response envelope formats and error payload shapes
- Endpoint reference tables (HTTP method, route, parameters, return type)
- Code examples (curl / fetch)
- Add a cross-link to
API_REFERENCE.md in docs/README.md and docs/architecture/ARCHITECTURE.md.
Tasks
Problem Statement
While Repowise maintains dedicated reference documentation for the CLI (
CLI_REFERENCE.md), configuration schema (CONFIG.md), and MCP tools (MCP_TOOLS.md) underdocs/reference/, there is currently no REST API Reference document (API_REFERENCE.md).The FastAPI backend (
repowise serve) powers both the Next.js web dashboard and external HTTP clients, exposing 33 router modules underpackages/server/src/repowise/server/routers/. While individual endpoints are mentioned in passing across architecture deep-dives, developers building custom integrations or queryingrepowise serveprogrammatically lack a single, authoritative API reference detailing request/response schemas, parameters, authentication, and status codes.Undocumented Endpoint Clusters
Below is the breakdown of the 33 router modules that require OpenAPI / Markdown documentation:
1. Repository Management & Sync (
routers/repos.py,routers/jobs.py)GET /api/repos— List registered repositoriesGET /api/repos/summary— Aggregate stats for all repositories in one callPOST /api/repos— Register a new repositoryPOST /api/repos/{id}/sync— Trigger structural graph sync (no LLM calls)POST /api/repos/{id}/full-resync— Full regeneration of wiki pages and vector embeddingsGET /api/jobs&GET /api/jobs/{id}/stream— Background job status and live SSE progress stream2. Workspace & Multi-Repo Architecture (
routers/workspace.py,routers/coupling.py)GET /api/workspace/system-graph— System-wide cross-repo dependency graphGET /api/workspace/contracts&/detail— Extracted API contract links and schemasGET /api/workspace/blast-radius— Cross-repository blast radius analysisGET /api/workspace/breaking-changes— Incompatible cross-repo contract reportGET /api/workspace/conformance— Architectural boundary conformance reportGET /api/workspace/architecture— System score and role metrics per repo/serviceGET /api/workspace/diagnostics— Workspace health and drift diagnostics3. Refactoring & Code Health (
routers/refactoring.py,routers/code_health/)GET /api/repos/{id}/refactoring/opportunities— Ranked refactoring suggestionsGET /api/repos/{id}/refactoring/opportunities/{opportunity_id}— Detailed refactoring planPOST /api/repos/{id}/refactoring/{suggestion_id}/generate-code— Generate refactored diffGET/PUT /api/repos/{id}/refactoring/settings— Toggle LLM refactoring settingsGET /api/repos/{id}/health/overview— Defect, maintainability, and performance scoresGET /api/repos/{id}/health/coverage— Coverage ingestion stats and per-file test coverage4. Architecture Visualization & C4 (
routers/c4.py)GET /api/graph/{id}/c4/l1— L1 System Context diagram payloadGET /api/graph/{id}/c4/l2— L2 Container diagram payloadGET /api/graph/{id}/c4/l3— L3 Component diagram payloadGET /api/graph/{id}/c4/structurizr— Structurizr DSL exportGET /api/graph/{id}/c4/mermaid— Mermaid SVG/diagram export5. Search, Symbols & Documentation (
routers/search.py,routers/pages.py,routers/symbols.py)GET /api/search— Hybrid search (semantic vector + FTS5/tsvector full-text)GET /api/pages— Wiki page retrieval (supportsfields=summaryorfields=full)GET /api/symbols— Symbol index and filterable call graph6. Architectural Decisions & Episodes (
routers/decisions.py,routers/episodes.py)GET /api/repos/{id}/decisions— ADR list and candidatesGET /api/repos/{id}/decisions/lane-counts— Decision counts by lifecycle laneGET /api/repos/{id}/episodes— Mined transcripts and decisions over HTTP7. Codebase Chat (
routers/chat.py)POST /api/repos/{id}/chat/messages— SSE streaming agentic Q&A loopGET/DELETE /api/repos/{id}/chat/conversations— Conversation history persistence8. Webhooks & System Operations (
routers/webhooks.py,routers/meta.py,routers/mcp.py)POST /api/webhooks/github— GitHub push webhook (HMAC verified)POST /api/webhooks/gitlab— GitLab push webhookGET/PATCH /api/mcp/tools— Read/toggle active MCP tool surface per repoGET /health&GET /metrics— Liveness/readiness probes and Prometheus metricsProposed Solution
docs/reference/API_REFERENCE.mdstructured by resource area:REPOWISE_API_KEYbearer token requirements)API_REFERENCE.mdindocs/README.mdanddocs/architecture/ARCHITECTURE.md.Tasks
docs/reference/API_REFERENCE.md