Skip to content

HTTP and WebSocket routes

Every route the Django backend serves, grouped by mount, with the methods its view defines and the first line of the view's docstring — generated from the URLconf.

93 HTTP routes across 13 mounts, read statically from backend/law_ai/urls.py and the modules it includes. Authentication and per-scope API keys are described in api-examples.md, which carries the curl examples, and security.md. Change a route in its urls.py, then run python3 scripts/gen_route_reference.py.

/

Route Methods View Summary
/ ANY root Service banner for the API root.
/admin/ ANY django.contrib.admin The Django admin site.

/health/

Also mounted without the trailing slash (/health), so the bare prefix resolves too.

Route Methods View Summary
/health/ GET HealthView

/version/

Also mounted without the trailing slash (/version), so the bare prefix resolves too.

Route Methods View Summary
/version/ GET VersionView Release version and build provenance of the running service.

/api/auth/

Route Methods View Summary
/api/auth/csrf GET CsrfView Hand a browser client the CSRF cookie + token before it POSTs.
/api/auth/login POST LoginView
/api/auth/logout POST LogoutView
/api/auth/me GET MeView
/api/auth/token POST TokenView RFC 6749 token endpoint (BL-20260503-13).
/api/auth/token/revoke POST TokenRevokeView RFC 7009 revocation.

/api/settings/

Route Methods View Summary
/api/settings/values GET SettingValuesView GET /api/settings/values — every row in the caller's scope chain.
/api/settings/values/<str:scope_id>/<str:key> PUT DELETE SettingValueDetailView PUT/DELETE /api/settings/values/<scope_id>/<key>.

/api/agents/

Also mounted without the trailing slash (/api/agents), so the bare prefix resolves too.

Route Methods View Summary
/api/agents/ GET AgentListView
/api/agents/runs GET AgentRunsView
/api/agents/runs/<str:trace_id> GET AgentRunDetailView Return all audit events sharing trace_id (parent + children).
/api/agents/metrics GET AgentMetricsView Aggregate per-agent metrics from the last N audit events.
/api/agents/backlog GET AgentBacklogView
/api/agents/specs GET AgentSpecsView
/api/agents/health/local-ai GET LocalAIHealthView
/api/agents/autonomy/legalbench-history GET AutonomyLegalbenchHistoryView Accuracy over time, one series per LegalBench subset.
/api/agents/autonomy/runs GET AutonomyRunsView The last N autonomy cycles: kind, status, duration (BL-20260906-23).
/api/agents/autonomy/recent-quarantine GET AutonomyQuarantineView The ten newest quarantined documents still waiting on a human (§5).

/api/analysis/

Also mounted without the trailing slash (/api/analysis), so the bare prefix resolves too.

Route Methods View Summary
/api/analysis/ POST AnalysisView
/api/analysis/threads/<str:thread_id> GET AnalysisThreadView GET /api/analysis/threads/<thread_id> — inspect a LangGraph thread.
/api/analysis/<str:analysis_id>/share GET POST AnalysisShareView Mint (POST) or list (GET) the share links of one analysis.
/api/analysis/<str:analysis_id>/share/<str:slug> DELETE AnalysisShareRevokeView DELETE /api/analysis/<id>/share/<slug> — revoke one link.
/api/analysis/<str:analysis_id> GET AnalysisDetailView GET /api/analysis/<analysis_id> — revisit a persisted run.

/api/shared/

Route Methods View Summary
/api/shared/<str:slug> GET SharedAnalysisView Resolve a share slug to the analysis it bookmarks.

/api/graph/

Route Methods View Summary
/api/graph/stats GET StatsView
/api/graph/cases GET CasesView
/api/graph/courts GET CourtsView /api/graph/courts — distinct Case.court values with counts.
/api/graph/path GET PathView /api/graph/path?from=&to=&max_hops= — precedent chain between two cases.
/api/graph/neighborhood/<str:case_id> GET NeighborhoodView

/api/lsat/

Route Methods View Summary
/api/lsat/sections GET SectionsView
/api/lsat/sections/<str:code> GET SectionDetailView
/api/lsat/concepts GET ConceptsView
/api/lsat/concepts/<str:concept_id> GET ConceptDetailView
/api/lsat/passages GET PassagesView
/api/lsat/passages/<str:passage_id> GET PassageDetailView
/api/lsat/questions GET QuestionsView
/api/lsat/questions/<str:question_id> GET QuestionDetailView
/api/lsat/questions/<str:question_id>/guide GET GuideView GET /api/lsat/questions/<id>/guide — progressive solve guide.
/api/lsat/questions/<str:question_id>/hint POST HintRevealView POST /api/lsat/questions/<id>/hint — one revealed step (FR-6).
/api/lsat/questions/<str:question_id>/cross-check POST CrossCheckView POST /api/lsat/questions/<id>/cross-check — spec 045 FR-14.
/api/lsat/questions/<str:question_id>/diagnose GET POST DiagnoseView /api/lsat/questions/<id>/diagnose — the type-recognition exercise.
/api/lsat/questions/<str:question_id>/contrast GET ContrastView GET /api/lsat/questions/<id>/contrast — the question's contrast set (spec 054).
/api/lsat/questions/<str:question_id>/variations POST VariationDraftView POST /api/lsat/questions/<id>/variations — draft one contrast variation.
/api/lsat/questions/<str:question_id>/review POST QuestionReviewView POST /api/lsat/questions/<id>/review — judge one bank item; rewrite if needed.
/api/lsat/playbooks GET PlaybooksView GET /api/lsat/playbooks?section= — every question type's playbook.
/api/lsat/playbooks/<str:archetype_id> GET PlaybookDetailView GET /api/lsat/playbooks/<archetype_id> — one type, with where to study it.
/api/lsat/validation GET ValidationView GET /api/lsat/validation — spec 045 FR-15 accuracy report.
/api/lsat/library GET LibraryIndexView GET /api/lsat/library — the contents rail.
/api/lsat/library/read GET POST LibraryReadView GET\|POST /api/lsat/library/read — which articles have been read.
/api/lsat/library/tracks GET LibraryTracksView GET /api/lsat/library/tracks — curated reading paths.
/api/lsat/library/search GET LibrarySearchView GET /api/lsat/library/search?q= — ranked hits with snippets.
/api/lsat/library/health GET LibraryHealthView GET /api/lsat/library/health — the deterministic audit (FR-14).
/api/lsat/library/<str:article_id> GET LibraryArticleView GET /api/lsat/library/<id> — one article with its cross-references resolved.
/api/lsat/writing/prompts GET WritingPromptsView GET /api/lsat/writing/prompts — the prompt library, model-free.
/api/lsat/writing/prompts/<str:prompt_id> GET WritingPromptDetailView GET /api/lsat/writing/prompts/<id> — one prompt plus its rubric.
/api/lsat/writing/rubric GET WritingRubricView GET /api/lsat/writing/rubric — the rubric, for offline self-scoring.
/api/lsat/writing/evaluate POST WritingEvaluateView POST /api/lsat/writing/evaluate — rubric-scored feedback (FR-4).
/api/lsat/grade POST GradeView
/api/lsat/stats GET StatsView GET /api/lsat/stats — how practice is going.
/api/lsat/tutor POST TutorView
/api/lsat/proposals GET ProposalsView GET /api/lsat/proposals — list proposals filtered by status.
/api/lsat/proposals/generate POST ProposalGenerateView POST /api/lsat/proposals/generate — synchronously draft N questions.
/api/lsat/guides/generate POST GuideGenerateView POST /api/lsat/guides/generate — draft one solve guide (spec 045 FR-9).
/api/lsat/proposals/passages/approve POST ProposalPassageApproveView POST /api/lsat/proposals/passages/approve — promote a parked passage.
/api/lsat/proposals/<str:proposal_id>/approve POST ProposalApproveView POST /api/lsat/proposals/<id>/approve — promote draft to bank.
/api/lsat/proposals/<str:proposal_id>/reject POST ProposalRejectView POST /api/lsat/proposals/<id>/reject — mark draft rejected.
/api/lsat/intake/ocr GET POST ScanIntakeView POST /api/lsat/intake/ocr — a scanned page becomes pending proposals.
/api/lsat/factory/status GET FactoryStatusView GET /api/lsat/factory/status — what the next batch will target.
/api/lsat/gaps GET GapsView GET /api/lsat/gaps — weakest (section, concept) pairs.

/api/matters/

Also mounted without the trailing slash (/api/matters), so the bare prefix resolves too.

Route Methods View Summary
/api/matters/ GET POST MatterListView GET /api/matters list · POST /api/matters create.
/api/matters/calendar GET MatterCalendarView GET /api/matters/calendar — every open dated task the caller owns.
/api/matters/<str:slug> GET PATCH MatterDetailView GET/PATCH /api/matters/<slug> — read or update one owned matter.
/api/matters/<str:slug>/intake/ocrmd GET POST MatterOcrmdIntakeView GET/POST /api/matters/<slug>/intake/ocrmd — a scanned page filed on this matter.
/api/matters/<str:slug>/artifacts GET POST MatterArtifactListView GET/POST /api/matters/<slug>/artifacts.
/api/matters/<str:slug>/authorities GET POST MatterAuthorityListView GET/POST /api/matters/<slug>/authorities — the matter's cited law.
/api/matters/<str:slug>/tasks GET POST MatterTaskListView GET/POST /api/matters/<slug>/tasks — the action stage's to-do list.
/api/matters/<str:slug>/tasks/<int:task_id> PATCH MatterTaskDetailView PATCH /api/matters/<slug>/tasks/<id> — complete, reschedule, archive.
/api/matters/<str:slug>/export GET MatterExportView GET /api/matters/<slug>/export — the portability bundle.
/api/matters/<str:slug>/memo GET MatterMemoView GET /api/matters/<slug>/memo — a deterministic draft memo.
/api/matters/<str:slug>/study-plan GET MatterStudyPlanView GET /api/matters/<slug>/study-plan — doctrine gaps → LSAT material.

/api/account/

Route Methods View Summary
/api/account/export GET AccountExportView GET /api/account/export — every matter the caller owns, in one file.
/api/account/delete POST AccountDeleteView POST /api/account/delete — de-identify this account.

/api/ingestion/

Route Methods View Summary
/api/ingestion/ocrmd/status GET OcrmdStatusView GET /api/ingestion/ocrmd/status — is the scanner library installed and on, where its store is, which OCR engines it found, and which doors this platform opens.
/api/ingestion/ocrmd/scan POST OcrmdScanView POST /api/ingestion/ocrmd/scan — OCR an uploaded image or PDF here, then route.
/api/ingestion/reviews GET ReviewListView GET /api/ingestion/reviews — the queue.
/api/ingestion/reviews/detail GET ReviewDetailView GET /api/ingestion/reviews/detail?id=… — one row, payload included.
/api/ingestion/reviews/approve POST ReviewApproveView POST /api/ingestion/reviews/approve — approve, then commit inline.
/api/ingestion/reviews/reject POST ReviewRejectView POST /api/ingestion/reviews/reject — record a rejection + rationale.
/api/ingestion/reviews/re-extract POST ReviewReextractView POST /api/ingestion/reviews/re-extract — re-score with today's extractor.

WebSocket (backend/law_ai/agentsapi/routing.py)

Route Methods View Summary
^ws/agents/ops/?$ WS OpsDashboardConsumer Push channel for the ops dashboard (BL-20260429-16).
^ws/agents/(?P<run_id>[\w\-]+)/?$ WS AgentRunConsumer Subscribes the client to agent-run-<run_id> and emits ready.