Documentation · Integrations

API and CLI

Corvu opens to a script the same way it opens to a person: the same projects, the same permissions. Three doors — the public REST API, an MCP server for Claude and other clients, and the corvu commands in a terminal.

Tokens and scopes

Issue a token in “Settings → Tokens” (personal) or in the project's “Tokens” tab (project); an administrator issues tokens of the cva_ kind. Send it in the Authorization: Bearer … header. It opens only /api/public/v1/* and /mcp: the product's internal API does not open to a token. An administrator can switch API access off entirely or for a member.

KindPrefixSpeaks for
Personalcvp_You: your permissions, your projects. A project is named with ?space= or the space field.
Projectcvs_One project. What it creates belongs to the person who issued it; other projects answer “not found”.
Admincva_A workspace administrator; the only kind that can carry the admin scope.
Provisioningcvm_Only /scim/v2: automatic creation and deactivation of people from a directory; opens nothing else.
ScopeWhat it opens
read_documentsReading analyses, documents, metrics, search and a run's status.
askNew and follow-up questions.
rebuildRebuilding documents and analyses.
write_contextWriting context files; the “edit” level in the project is needed as well.
read_journalA project's journal.
adminMembers, groups, usage (cva_ only).

A scope is a ceiling, not a replacement for a level: a token can do no more than its owner. Lifetime is 7 to 365 days (90 by default). The request ceiling is 60 per minute per token and a separate 10 per minute for ask and rebuild. Errors always arrive as {"code", "message"}.

Public API routes

Every path starts with /api/public/v1. The list is built from the application's real routes.

MethodPathScopeWhat it does
GET/api/public/v1/membersadminEvery member of the workspace.
POST/api/public/v1/membersadminInvite somebody, or create them at once with a password.
PUT/api/public/v1/projects/{space_uid}/membersadminLet somebody into a project or change their level (ownership is handed over another way).
GET/api/public/v1/projects/{space_uid}/membersadminWho is in a project.
GET/api/public/v1/groupsadminThe workspace's groups, or the ones let into a project (?space=).
GET/api/public/v1/usageadminSpend and stocks across the whole installation.
GET/api/public/v1/journalread_journal or adminA project's journal: who did what.
POST/api/public/v1/askaskA new question (creates an analysis). Waits up to wait_s seconds (default 20, at most 120): answers 200 with the answer, or 202 with an analysis_id.
POST/api/public/v1/analyses/{conv_uid}/askaskA follow-up question in an analysis that already exists.
GET/api/public/v1/analysesread_documentsThe analyses this token may see.
GET/api/public/v1/analyses/{conv_uid}read_documentsOne analysis: turns, answer, status (done, failed, running, abandoned, empty).
GET/api/public/v1/contextread_documents or write_contextThe project's recorded context: definitions, metrics, vetted queries.
PUT/api/public/v1/context/filewrite_contextCreate or replace one .md, .sql or .py file. Body: path, body, base_hash, dry_run. A stale base_hash is a 409.
GET/api/public/v1/documents/{page_uid}read_documentsA document as readers see it: ?format=json (default) or markdown.
GET/api/public/v1/metricsread_documentsThe project's metrics: declarations, not values.
POST/api/public/v1/metrics/{name}/valueread_documentsOne metric's value now. Body: optional source and period ({"from", "to"}, dates as YYYY-MM-DD, the end excluded).
POST/api/public/v1/documents/{page_uid}/rebuildrebuildRecalculate a document, like the Recalculate button but without sending mail. Answers with a run_id.
POST/api/public/v1/analyses/{conv_uid}/rebuildrebuildRecalculate an analysis on fresh data. Answers with a run_id.
GET/api/public/v1/runs/{run_id}read_documentsStatus and outcome of a run started by a rebuild.
POST/api/public/v1/runs/{run_id}/cancelrebuildStop a rebuild that is still running. Answers 200 with the final status, or 409 E_NOT_RUNNING if the run has already finished.
GET/api/public/v1/openapi.jsonany tokenThe OpenAPI schema of this API.
GET/api/public/v1/docsany tokenA browsable reference for this API.
GET/api/public/v1/searchread_documentsSearch analyses, documents, metrics, tables and steps within what the token may see.
GET/api/public/v1/meany tokenWhose token this is: kind, owner, project, scopes, expiry.

Examples

export CORVU_URL=https://corvu.example.com
export CORVU_TOKEN=cvp_xxxxxxxxxxxxxxxxxxxxxxxx   # your token

# whose token this is
curl -s "$CORVU_URL/api/public/v1/me" \
  -H "Authorization: Bearer $CORVU_TOKEN"

# a new question; wait up to 60 seconds for the answer
curl -s -X POST "$CORVU_URL/api/public/v1/ask" \
  -H "Authorization: Bearer $CORVU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question": "What was goods revenue for July 2026?", "wait_s": 60}'

The answer is {analysis_id, turn, status, answer, failure, provenance, warnings}. If it did not finish in time you get a 202 with an analysis_id: poll GET /analyses/{analysis_id}.

# a document as Markdown
curl -s "$CORVU_URL/api/public/v1/documents/pg_XXXXXXXX?format=markdown" \
  -H "Authorization: Bearer $CORVU_TOKEN"

# rebuild a document and look at the run
curl -s -X POST "$CORVU_URL/api/public/v1/documents/pg_XXXXXXXX/rebuild" \
  -H "Authorization: Bearer $CORVU_TOKEN"
curl -s "$CORVU_URL/api/public/v1/runs/RUN_ID" \
  -H "Authorization: Bearer $CORVU_TOKEN"

# a metric's value for July 2026 (the end of the period is excluded)
curl -s -X POST "$CORVU_URL/api/public/v1/metrics/revenue_goods/value" \
  -H "Authorization: Bearer $CORVU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"period": {"from": "2026-07-01", "to": "2026-08-01"}}'

# write a context file; a dry run first
curl -s -X PUT "$CORVU_URL/api/public/v1/context/file?space=sp_xxxxxxxx" \
  -H "Authorization: Bearer $CORVU_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"path": "olist/metrics/revenue_goods.sql", "body": "-- metric: ...", "base_hash": null, "dry_run": true}'

Writing context checks base_hash against what the server holds: a person's edit in the editor is never silently overwritten — you get a 409 and the current hash.

The MCP server

/mcp is a stateless MCP server over HTTP; the credential is the same Bearer token. Ten tools: search, ask, continue, get_analysis, get_document, get_step, get_metric_value, list_metrics, rebuild, get_run. There is no editing tool on purpose: corrections are made by asking through continue, so that the agent writes the provenance of a number.

Ready-made settings for Claude, Codex and Cursor are in “Settings → Integrations”. From a terminal, Claude Desktop or Codex is set up with:

corvu install agent-skill --claude   # or --codex

The corvu commands

The commands need nothing but an address and a token: --url / CORVU_URL and --token / CORVU_TOKEN. The token is never printed.

# a question; --wait waits up to N seconds, --follow continues an analysis
corvu ask "What was goods revenue for July 2026?" --wait 60

# a document as Markdown or JSON
corvu doc export pg_XXXXXXXX --format markdown -o report.md

# context files; --dry-run shows what would change
corvu context push olist/metrics/revenue_goods.sql --space sp_xxxxxxxx --dry-run

corvu ask and corvu doc export exit non-zero if the turn failed, and corvu context push does if even one file is refused (a stale hash is named in the message).

Ready to try it? Demo data is already inside.

Request access Sign in