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.
| Kind | Prefix | Speaks for |
|---|---|---|
| Personal | cvp_ | You: your permissions, your projects. A project is named with ?space= or the space field. |
| Project | cvs_ | One project. What it creates belongs to the person who issued it; other projects answer “not found”. |
| Admin | cva_ | A workspace administrator; the only kind that can carry the admin scope. |
| Provisioning | cvm_ | Only /scim/v2: automatic creation and deactivation of people from a directory; opens nothing else. |
| Scope | What it opens |
|---|---|
read_documents | Reading analyses, documents, metrics, search and a run's status. |
ask | New and follow-up questions. |
rebuild | Rebuilding documents and analyses. |
write_context | Writing context files; the “edit” level in the project is needed as well. |
read_journal | A project's journal. |
admin | Members, 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.
| Method | Path | Scope | What it does |
|---|---|---|---|
GET | /api/public/v1/members | admin | Every member of the workspace. |
POST | /api/public/v1/members | admin | Invite somebody, or create them at once with a password. |
PUT | /api/public/v1/projects/{space_uid}/members | admin | Let somebody into a project or change their level (ownership is handed over another way). |
GET | /api/public/v1/projects/{space_uid}/members | admin | Who is in a project. |
GET | /api/public/v1/groups | admin | The workspace's groups, or the ones let into a project (?space=). |
GET | /api/public/v1/usage | admin | Spend and stocks across the whole installation. |
GET | /api/public/v1/journal | read_journal or admin | A project's journal: who did what. |
POST | /api/public/v1/ask | ask | A 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}/ask | ask | A follow-up question in an analysis that already exists. |
GET | /api/public/v1/analyses | read_documents | The analyses this token may see. |
GET | /api/public/v1/analyses/{conv_uid} | read_documents | One analysis: turns, answer, status (done, failed, running, abandoned, empty). |
GET | /api/public/v1/context | read_documents or write_context | The project's recorded context: definitions, metrics, vetted queries. |
PUT | /api/public/v1/context/file | write_context | Create 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_documents | A document as readers see it: ?format=json (default) or markdown. |
GET | /api/public/v1/metrics | read_documents | The project's metrics: declarations, not values. |
POST | /api/public/v1/metrics/{name}/value | read_documents | One 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}/rebuild | rebuild | Recalculate a document, like the Recalculate button but without sending mail. Answers with a run_id. |
POST | /api/public/v1/analyses/{conv_uid}/rebuild | rebuild | Recalculate an analysis on fresh data. Answers with a run_id. |
GET | /api/public/v1/runs/{run_id} | read_documents | Status and outcome of a run started by a rebuild. |
POST | /api/public/v1/runs/{run_id}/cancel | rebuild | Stop 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.json | any token | The OpenAPI schema of this API. |
GET | /api/public/v1/docs | any token | A browsable reference for this API. |
GET | /api/public/v1/search | read_documents | Search analyses, documents, metrics, tables and steps within what the token may see. |
GET | /api/public/v1/me | any token | Whose 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