Skip to documentation

API & MCP

Workspace API

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/documentsList documents; create a document.
GET/PUT/DELETE/documents/:docIdRead, save (write-through), soft-delete.
GET/documents/search?q=…Content search behind the documents list.
GET/documents/:docId/entitiesThe document's entities rail: mentioned + related-via-graph entities.

Graph

GET/graph/overviewDegree-capped starting view for the explorer.
GET/graph/neighborhoodOne node's neighbors with per-hop caps.
GET/graph/entitiesSearch / list entities.
GET/graph/expandFrontier expansion from seed entities.
GET/graph/edge?src&dstDeterministic edge insight: strength, direction, evidence.
GET/graph/edge-strengthsBulk per-edge strength scores (thickness + arrows).

Coverage

GET/coverageThe BU × topic matrix, summary, and interview-next.
POST/coverage/snapshotPersist a coverage snapshot for auditability.

Agents & runs

Agents

GET/POST/agentsList agents with latest version; create an agent.
GET/agents/:slugAn agent with its latest version.
POST/agents/:slug/versionsPublish a new immutable version.
POST/agents/:slug/runsStart a run (UI path; SSE or JSON).

Runs, approvals & feedback

GET/runsList runs.
GET/runs/:idA run and its steps.
POST/runs/:id/cancelCooperatively cancel a run.
GET/approvalsList pending HITL approvals.
POST/approvals/:idAllow / deny an approval and resume the run.
POST/feedbackAttach feedback to a run or message.

Chat

POST/chatGrounded chat: hybrid retrieval + streamed [Sn] citations.

AI configuration

Providers & keys

POST/providersAdd an OpenAI-compatible provider by base URL.
POST/providers/seedSeed frontier providers + default slots from env keys.
PUT/providers/slotsBind a model slot to a provider + model id.
DELETE/providers/:providerIdRemove a provider.
POST/providers/:providerId/credentialStore a workspace API key (write-only).
POST/providers/ollama-bridgeOne-click Ollama local-dev bridge preset.
GET/POST/apikeysList / create /api/v1 keys (owner-gated create).
DELETE/apikeys/:idRevoke a key.

MCP servers

GET/POST/mcpList / register MCP servers.
DELETE/mcp/:idRemove a server.
POST/mcp/:id/discoverDiscover and cache the server's tools.
POST/mcp/:id/enableEnable / disable a server.

Evals

Golden sets & runs

GET/POST/goldenList / create golden items.
GET/PATCH/DELETE/golden/:idRead, edit, archive a golden item.
POST/golden/promoteJudge-decompose a supplied answer into a draft golden; no eval-feedback row (evals:write).
GET/POST/evals/runsList / start eval runs.
GET/evals/runs/:idAn eval run with per-item results.
GET/evals/diffA/B diff two runs (per-item assertion flips).
GET/POST/evals/driftDrift snapshots and comparisons.
GET/POST/evals/configsList / create eval configs.
PATCH/evals/judgments/:idHuman-override a judge verdict (append-only).
POST/evals/feedback/promotePromote 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.

Operations & lifecycle

Cost & schedules

GET/costSpend summary by slot / model / day.
GET/cost/by-agentSpend attributed per agent.
GET/cost/recentRecent runs with cost.
GET/POST/schedulesList / create scheduled agent runs (cron).
DELETE/schedules/:agentSlugUnschedule an agent.

Export & offboarding

GET/POST/exportList / create a workspace export tarball.
GET/export/:id/downloadDownload a finished export.
POST/workspace/destroyOffboarding delete cascade (owner-gated).