The in-app UI is a thin client over a backend-for-frontend (BFF) mounted at /api/w/:workspaceId/. These routes are session-authenticated (a logged-in member of the workspace), not Bearer-keyed — the programmatic surface is /api/v1. Paths below omit the /api/w/:workspaceId prefix.
Conventions
Every handler awaits its route params, guards with requireWorkspaceAccess(workspaceId) first (mapping a WorkspaceAccessError to its status), takes the workspace from the URL (never the session), and zod-validates bodies. Some mutations are owner-gated. See Errors & rate limits.
Content & knowledge base
Documents
GET/POST
/documents
List documents; create a document.
GET/PUT/DELETE
/documents/:docId
Read, save (write-through), soft-delete.
GET
/documents/search?q=…
Content search behind the documents list.
GET
/documents/:docId/entities
The document's entities rail: mentioned + related-via-graph entities.
Seed frontier providers + default slots from env keys.
PUT
/providers/slots
Bind a model slot to a provider + model id.
DELETE
/providers/:providerId
Remove a provider.
POST
/providers/:providerId/credential
Store a workspace API key (write-only).
POST
/providers/ollama-bridge
One-click Ollama local-dev bridge preset.
GET/POST
/apikeys
List / create /api/v1 keys (owner-gated create).
DELETE
/apikeys/:id
Revoke a key.
MCP servers
GET/POST
/mcp
List / register MCP servers.
DELETE
/mcp/:id
Remove a server.
POST
/mcp/:id/discover
Discover and cache the server's tools.
POST
/mcp/:id/enable
Enable / disable a server.
Evals
Golden sets & runs
GET/POST
/golden
List / create golden items.
GET/PATCH/DELETE
/golden/:id
Read, edit, archive a golden item.
POST
/golden/promote
Judge-decompose a supplied answer into a draft golden; no eval-feedback row (evals:write).
GET/POST
/evals/runs
List / start eval runs.
GET
/evals/runs/:id
An eval run with per-item results.
GET
/evals/diff
A/B diff two runs (per-item assertion flips).
GET/POST
/evals/drift
Drift snapshots and comparisons.
GET/POST
/evals/configs
List / create eval configs.
PATCH
/evals/judgments/:id
Human-override a judge verdict (append-only).
POST
/evals/feedback/promote
Promote reviewed corrected assertions: atomically append feedback + create a draft golden (evals:write).
The promotion routes are deliberately different. /golden/promote decomposes an answer payload with the judge model. /evals/feedback/promote accepts human-reviewed assertions plus run/result lineage, returns 201 {item, feedback}, and never auto-activates the draft. Missing run/result references return 404; a result/run mismatch returns 409. See the exact request contract and transaction boundary in the evaluation framework.