Skip to content

REST API

The Tavora REST API exposes every runtime capability under /api/sdk/*. The Go and TypeScript SDKs are thin wrappers — call this API directly from any language that can speak HTTP + multipart

  • SSE.
https://api.tavora.ai/api/sdk

In development: http://localhost:8080/api/sdk.

Every request authenticates via the X-API-Key header. Keys are app-scoped — one key, one app. Mint one in the admin web UI (covered in the platform’s internal docs) and store it via tavora login so the CLI picks it up too.

Terminal window
curl -H "X-API-Key: tvr_your_api_key" \
https://api.tavora.ai/api/sdk/app

For browser apps, mint short-lived keys via the session-token exchange — see Browser-based chat.

MethodPathDescription
GET/appApp metadata
GET/metricsAggregate token / agent / eval metrics
MethodPathDescription
GET/indexesList indexes
POST/indexesCreate an index
GET/indexes/:idGet an index
PATCH/indexes/:idUpdate an index
DELETE/indexes/:idDelete an index
MethodPathDescription
POST/indexes/:id/documents (multipart)Upload a document
GET/indexes/:id/documentsList documents in an index
GET/indexes/:id/documents/:docIdGet a document
GET/indexes/:id/documents/by-name/:nameGet by name
GET/indexes/:id/documents/by-name/:name/versionsList versions
DELETE/indexes/:id/documents/:docIdSoft-delete (or ?hard=true)
GET/documentsList documents across the app
GET/documents/:idGet a document by ID
DELETE/documents/:idSoft-delete (or ?hard=true)
POST/searchSemantic search (chunks)
POST/indexes/:id/searchSame, scoped to one index

Search accepts result_type: "document" to return one row per document with the best chunk inlined. Documents carry user-supplied provenance via the multipart metadata field; re-uploading with the same name bumps the version (use if_version for optimistic concurrency).

MethodPathDescription
POST/secret-vaultsCreate a secret vault
GET/secret-vaultsList secret vaults
GET/secret-vaults/:idGet a secret vault
PATCH/secret-vaults/:idUpdate
DELETE/secret-vaults/:idDelete
GET/secret-vaults/:id/secretsList secrets (redacted)
PUT/secret-vaults/:id/secrets/:namePut a secret value
DELETE/secret-vaults/:id/secrets/:nameDelete a secret

The API never returns plaintext. Tools that need a credential (LLM provider router, MCP auth.tokenRef resolver, Brave search) read the designated app vault internally; the agent’s JS sandbox does not surface a secret() primitive.

MethodPathDescription
GET/agents/system-promptInspect the runtime system prompt
POST/agentsCreate an agent session
GET/agentsList agent sessions
GET/agents/:idGet an agent session
DELETE/agents/:idDelete an agent session
POST/agents/:id/run (SSE)Stream a turn
POST/agents/:id/inputResolve a paused input_request
MethodPathDescription
GET/agent-configsList configs
GET/agent-configs/:idGet a config
DELETE/agent-configs/:idDelete
PATCH/agent-configs/:id/settingsPer-agent operator settings (pinned eval suite)
GET/agent-configs/:id/versionsList immutable version history
GET/agent-configs/:id/versions/:vidGet a single version snapshot
POST/agent-configs/:id/eval-runsTrigger an advisory eval run
GET/agent-configs/:id/eval-runsList advisory eval runs for this agent
GET/agent-configs/:id/eval-suiteResolve the agent’s pinned suite

Agents themselves are created and edited through the code-first source path — there’s no POST /agent-configs and no draft / publish / revert.

The tavora CLI uses this surface to author agents from a local folder. Application code rarely calls these directly.

MethodPathDescription
PUT/source-syncUpsert dev drafts from a manifest
POST/source-validateServer-side validate without persisting
POST/source-deployPromote drafts to a new published version
POST/source-renameRename an agent’s local id
POST/source-deleteDestroy a code-managed agent (cascades)
MethodPathDescription
POST/chat/completionsOpenAI-compatible chat (stateless)
POST/conversationsCreate a stored conversation
GET/conversationsList conversations
GET/conversations/:idGet a conversation with messages
DELETE/conversations/:idDelete a conversation
POST/conversations/:id/messagesSend a message
MethodPathDescription
GET/skillsList skills
GET/skills/:idGet a skill
POST/skills/validateLint a JS skill body
GET/skills/authoring-guideLive-generated skill authoring reference (Markdown)

Skills are authored as .js (module) and .md (prompt) files under tavora/agents/<id>/skills/ and arrive via source-sync. The REST surface is read-only.

MethodPathDescription
GET/scheduled-runsList
POST/scheduled-runsCreate
GET/scheduled-runs/:idGet
PATCH/scheduled-runs/:idUpdate
DELETE/scheduled-runs/:idDelete
MethodPathDescription
GET/evalsList eval cases
GET/evals/:idGet one
GET/eval-runsList runs
GET/eval-runs/:idGet a run
GET/eval-suitesList suites
GET/eval-suites/:idGet a suite
GET/eval-suites/:id/versionsList suite versions

Eval cases live as JSON files under tavora/agents/<id>/evals/ and flow through source-sync. Trigger runs per agent via POST /agent-configs/:id/eval-runs above.

MethodPathDescription
GET/prompt-templatesList
POST/prompt-templatesCreate
GET/prompt-templates/:idGet
PATCH/prompt-templates/:idUpdate
DELETE/prompt-templates/:idDelete
MethodPathDescription
GET/studio/:sessionIDEnriched trace for one session
POST/studio/:sessionID/replayReplay from step (SSE)
POST/studio/:sessionID/analyzeAI fix analysis
MethodPathDescription
GET/audit-logFilter audit entries (by action, subject, time range)
GET/audit-log/exportBulk export as JSON or CSV (SOC2 evidence)

Successful responses return JSON with the entity directly at the top level:

{
"id": "doc_abc123",
"title": "My Document",
"status": "ready",
"created_at": "2026-05-11T10:30:00Z"
}

Errors return a typed shape:

{
"error": "version_conflict",
"message": "document was modified",
"code": "version_conflict",
"current_version": 5
}

code is a stable machine-readable error code (e.g. "version_conflict", "NOT_FOUND"). Every other top-level field beyond error / message / code is structured detail an SDK or agent can act on programmatically. Common codes:

  • version_conflict — 409 on optimistic-concurrency mismatch; carries current_version.
  • NOT_FOUND — 404.
  • unauthorized — 401 (missing or invalid API key).

The Go and TS SDKs expose AsVersionConflict / asVersionConflict helpers to extract typed fields from these responses.