Skip to content

API Reference

This reference describes the supported customer integration and configuration API. Admin-assistant helpers and other routes used only by the first-party Admin application are intentionally not an external integration contract.

For request and response details that are easiest to understand as a complete workflow, use the linked feature guides alongside this route reference.

Set the root origin for your Cloud workspace or Enterprise deployment:

Terminal window
export SYNTHETICBREW_URL="https://YOUR_SYNTHETICBREW_ORIGIN"
export SYNTHETICBREW_TOKEN="bb_your_token"

Protected REST requests use JSON unless a route says otherwise:

Terminal window
curl "$SYNTHETICBREW_URL/api/v1/agents" \
-H "Authorization: Bearer $SYNTHETICBREW_TOKEN" \
-H "Accept: application/json"
  • JSON request: Content-Type: application/json
  • Config import: Content-Type: application/x-yaml
  • File upload: multipart/form-data
  • Chat streaming response: text/event-stream
  • Config export: YAML
  • Enterprise metrics: Prometheus text format

Create scoped keys in Admin -> API Keys. The API accepts those keys and valid signed JWTs as Bearer tokens:

Authorization: Bearer bb_your_api_token

Key names are unique among active keys: creating a second active key with the same name returns 409, because the name owns the key’s sessions and memory. An API key cannot call the key-management routes. POST /api/v1/auth/tokens, GET /api/v1/auth/tokens, and DELETE /api/v1/auth/tokens/{id} require the authenticated Admin session used by the dashboard.

ScopeGrants
chatSchema chat.
tasksTask creation, reads, transitions, and cancellation.
agents:read, agents:writeAgent, capability, and knowledge resource reads or writes.
models:read, models:writeModel reads or writes.
mcp:read, mcp:writeMCP server reads or writes.
schemas:read, schemas:writeSchema, relation, and schema-memory reads or writes.
sessions:read, sessions:writeSession reads or writes.
settings:read, settings:writeSettings reads or writes.
audit:readAudit-log reads.
resilience:read, resilience:writeCircuit-breaker reads or resets.
tools:readBuilt-in tool metadata.
configConfig reload, import, and export.
apiChat, tasks, sessions read, and read-only agent, model, MCP, schema, settings, audit, resilience, and tool access. It does not grant configuration writes.
provisionMCP provisioning reads plus create/update authority. It excludes destructive MCP management tools.
manageEverything in provision plus destructive MCP management authority.
adminAdministrative superscope. Grant only to trusted operators.

The short aliases agents, models, mcp, schemas, sessions, settings, audit, resilience, and tools mean read-only access to that resource.

When an Enterprise deployment explicitly enables local authentication, the local session endpoints are available:

MethodPathPurpose
POST/api/v1/auth/local-sessionIssue a local Admin session, or exchange an admin API token (Authorization: Bearer bb_…) for one.
POST/api/v1/auth/local-session/refreshRefresh that session.

These routes are deployment-local access helpers, not a Cloud authentication mechanism. Without a token, a session is issued only to a loopback connection and only while SYNTHETICBREW_LOCAL_SESSION_TOKENLESS is true; the connection’s address decides, not the Host header. With an admin API token the exchange works from any address. Errors carry a code:

StatuscodeMeaning
403admin_token_requiredNo session without a token on this connection.
401invalid_admin_tokenThe token is malformed, unknown, or revoked.
403insufficient_scopeThe token has no admin scope.

Sessions carry the audience syntheticbrew:local-session. See Enterprise on-premises for authentication choices.

MethodPathPurpose
GET/api/v1/healthReadiness information, version, agent count, and platform-default-model availability. Returns 503 with "status":"degraded" and "database":"unavailable" while the database is unreachable.
GET/api/v1/models/registryRead the built-in model catalog; filter by provider, tier, or supports_tools.
GET/api/v1/models/registry/providersList known provider metadata.
GET/.well-known/mcp/server-card.jsonDiscover the authenticated management MCP server and its capabilities.
GET/agent-setup/prompt.mdRead the generated coding-agent setup instructions for this deployment.
GET/widget.jsLoad the embeddable chat-widget bundle when it is installed in the deployment image.

The registry is a catalog, not your workspace’s configured model list. Use GET /api/v1/models for configured models.

When the OAuth authorization server is enabled, an MCP client uses these endpoints:

MethodPathPurpose
GET/.well-known/oauth-authorization-serverAuthorization-server metadata.
GET/.well-known/oauth-protected-resourceProtected-resource metadata.
GET/.well-known/oauth-protected-resource/api/v1/mcp/rpcResource-specific metadata for the MCP endpoint.
POST/oauth/registerDynamic client registration.
POST/oauth/tokenAuthorization-code exchange or refresh.
POST/api/v1/oauth/registerEdge-compatible alias for dynamic registration.
POST/api/v1/oauth/tokenEdge-compatible alias for token exchange or refresh.
GET/api/v1/oauth/authorize-infoAuthorization request information used by the browser consent UI.

Dynamic registration accepts a redirect_uri only with https and a host, http on a loopback host, a reverse-domain private-use scheme such as com.example.app:/callback, or the cursor, vscode, and vscode-insiders schemes. Any other scheme, and any URI with a fragment, is rejected.

Authorization codes are single-use and expire after five minutes. Let the coding agent’s OAuth client perform registration and exchange; do not script the Admin-only consent approval or exchange-status routes. For browsers and coding agents on different machines, follow Connect a coding agent.

MethodPathScopePurpose
POST/api/v1/schemas/{name}/chatchatSend a message or resume an interrupt. Streams SSE by default.

{name} is the immutable schema name, never its UUID. The schema must have chat enabled and an entry agent. The request body accepts message, session_id, stream, user_sub, headers, or resume_interrupt as described in REST API chat integration.

MethodPathScopePurpose
GET/api/v1/agentsagents:readList agents.
GET/api/v1/agents/{name}agents:readRead an agent.
POST/api/v1/agentsagents:writeCreate an agent.
PUT/api/v1/agents/{name}agents:writeFully replace an agent’s writable configuration.
PATCH/api/v1/agents/{name}agents:writeUpdate selected agent fields.
DELETE/api/v1/agents/{name}agents:writeDelete an agent.
GET/api/v1/agents/{name}/lifecycleagents:readInspect runtime lifecycle state when lifecycle management is enabled.
GET/api/v1/agents/{name}/capabilitiesagents:readList capability bindings.
POST/api/v1/agents/{name}/capabilitiesagents:writeAdd a capability binding.
PUT/api/v1/agents/{name}/capabilities/{capId}agents:writeReplace a capability binding.
DELETE/api/v1/agents/{name}/capabilities/{capId}agents:writeRemove a capability binding.

Agent names are stable URL handles. can_spawn is derived from schema delegation relations and is read-only; create or remove a relation instead of writing that field. Use PATCH for partial changes. PUT requires the complete writable resource.

See Agents and Multi-agent systems.

MethodPathScopePurpose
GET/api/v1/modelsmodels:readList configured models.
POST/api/v1/modelsmodels:writeCreate a model.
PUT/api/v1/models/{name}models:writeFully replace a model.
PATCH/api/v1/models/{name}models:writeUpdate selected model fields.
DELETE/api/v1/models/{name}models:writeDelete a model. Returns 409 while an agent or a knowledge base uses it.
POST/api/v1/models/{name}/verifymodels:writeTest connectivity and tool-calling support.

Accepted input types are ollama, openai_compatible, anthropic, azure_openai, and openrouter. openrouter is an input alias stored as openai_compatible; it defaults the base URL to OpenRouter when one is not supplied. Model kind is chat or embedding.

Terminal window
curl -X POST "$SYNTHETICBREW_URL/api/v1/models" \
-H "Authorization: Bearer $SYNTHETICBREW_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name":"primary-model",
"type":"openrouter",
"kind":"chat",
"model_name":"anthropic/claude-sonnet-4",
"api_key":"YOUR_PROVIDER_KEY"
}'

See Models and Model selection.

MethodPathScopePurpose
POST/api/v1/taskstasksAdd a subtask to an existing task.
GET/api/v1/taskstasksList tasks.
GET/api/v1/tasks/{id}tasksRead task detail.
DELETE/api/v1/tasks/{id}tasksCancel a non-terminal task; optional body {"reason":"..."}.
GET/api/v1/tasks/{id}/subtaskstasksList direct subtasks.
POST/api/v1/tasks/{id}/approvetasksTransition draft to approved.
POST/api/v1/tasks/{id}/starttasksTransition approved or pending to in_progress.
POST/api/v1/tasks/{id}/completetasksComplete in-progress work; optional result.
POST/api/v1/tasks/{id}/failtasksFail in-progress work; requires reason.
POST/api/v1/tasks/{id}/prioritytasksSet priority 0, 1, or 2.

Every task belongs to a chat session. Top-level tasks are created by agents through manage_tasks; over REST, POST /api/v1/tasks adds a subtask to a task an agent created, and the subtask joins that task’s session. A request without parent_task_id returns 400.

Add a subtask:

Terminal window
curl -X POST "$SYNTHETICBREW_URL/api/v1/tasks" \
-H "Authorization: Bearer $SYNTHETICBREW_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"parent_task_id":"5f0c2b7e-9d41-4f3a-8c55-2a6f1e9b7d10",
"title":"Prepare the launch brief",
"description":"Draft a brief and verify every launch dependency.",
"agent_name":"researcher",
"mode":"background",
"priority":1,
"acceptance_criteria":["Sources linked","Dependencies verified"],
"blocked_by":[],
"require_approval":true
}'
{
"task_id": "8e449f4d-3b78-4e6f-85e6-ea4901670528",
"status": "draft"
}

mode is interactive or background. Priority is 0 (normal), 1 (high), or 2 (critical). Without approval the initial status is pending; with require_approval: true it is draft.

List query parameters are source, agent_name, status, page, and per_page. The default and maximum page size are 100. Responses use {data,total,page,per_page,total_pages}. Task IDs and blocker IDs are UUIDs.

Current limitation: agent_name is required in the create body, but the task does not retain it. The agent_name and source response fields are therefore empty, and those two list parameters do not narrow results. status and pagination do work. Use session, audit, or tool-call data when you need attribution.

See Tasks and lifecycle.

MethodPathScopePurpose
GET/api/v1/schemasschemas:readList schemas.
GET/api/v1/schemas/{name}schemas:readRead a schema by name.
POST/api/v1/schemasschemas:writeCreate a schema.
PUT/api/v1/schemas/{name}schemas:writeFully replace a schema.
PATCH/api/v1/schemas/{name}schemas:writeUpdate selected schema fields.
DELETE/api/v1/schemas/{name}schemas:writeDelete a schema.
GET/api/v1/schemas/{name}/agentsschemas:readList schema members derived from relations.
GET/api/v1/schemas/{name}/agent-relationsschemas:readList delegation relations.
GET/api/v1/schemas/{name}/agent-relations/{relationId}schemas:readRead a relation.
POST/api/v1/schemas/{name}/agent-relationsschemas:writeCreate a source-to-target relation.
PUT/api/v1/schemas/{name}/agent-relations/{relationId}schemas:writeReplace a relation.
DELETE/api/v1/schemas/{name}/agent-relations/{relationId}schemas:writeDelete a relation.
GET/api/v1/schemas/{name}/memoryschemas:readList persistent memory entries.
DELETE/api/v1/schemas/{name}/memoryschemas:writeClear schema memory.
GET/api/v1/schemas/{name}/memory/user?user_sub=sessions:readList the memory chat wrote for one person under the calling key.
DELETE/api/v1/schemas/{name}/memory/user?user_sub=sessions:writeErase that person’s memory; returns {"deleted": n}. A user_sub chat would not accept is 400 and nothing is erased.
GET/api/v1/schemas/{name}/memory/callersessions:readList memory written under the calling key itself, before it passed a user_sub.
DELETE/api/v1/schemas/{name}/memory/callersessions:writeErase that shared memory; people’s memory is never touched.
DELETE/api/v1/schemas/{name}/memory/{entry_id}schemas:writeDelete one memory entry.

Schema membership is derived from agent relations; there is no separate membership write route. A relation’s source agent may delegate to its target agent.

See Schemas and session versus persistent memory.

MethodPathScopePurpose
GET/api/v1/sessionssessions:readList sessions by user, status, time, or a metadata key and value. The accepted agent_name parameter currently does not narrow results because sessions do not retain agent assignment.
GET/api/v1/sessions/{id}sessions:readRead session metadata.
GET/api/v1/sessions/{id}/messagessessions:readRead persisted events.
POST/api/v1/sessionssessions:writeCreate a session record.
PUT/api/v1/sessions/{id}sessions:writeUpdate title, status, or opaque metadata.
DELETE/api/v1/sessions/{id}sessions:writeDelete a session.

List filters are agent_name, user_sub, status, from, to, page, and per_page. The default page size is 20 and the maximum is 100. The response uses {data,total,page,per_page,per_page_max,total_pages}. Session IDs must be UUIDs and metadata writes are capped at 16 KB.

Regular end-user JWTs are restricted to their own user_sub. Admin sessions and trusted API-token services can access all sessions in the workspace. See REST API chat integration for examples and the response shape.

Knowledge uploads are stateless HTTP operations: upload a file in one request, retain the returned file identifier, and query the resource afterward. The upload request itself does not create a long-running client session.

MethodPathScopePurpose
GET/api/v1/knowledge-basesagents:readList knowledge bases.
GET/api/v1/knowledge-bases/{name}agents:readRead a knowledge base.
POST/api/v1/knowledge-basesagents:writeCreate a knowledge base.
PUT/api/v1/knowledge-bases/{name}agents:writeFully replace a knowledge base.
PATCH/api/v1/knowledge-bases/{name}agents:writeUpdate selected knowledge-base fields.
DELETE/api/v1/knowledge-bases/{name}agents:writeDelete a knowledge base.
POST/api/v1/knowledge-bases/{name}/agents/{agent_name}agents:writeLink an agent and enable its Knowledge capability.
DELETE/api/v1/knowledge-bases/{name}/agents/{agent_name}agents:writeUnlink an agent.
GET/api/v1/knowledge-bases/{name}/filesagents:readList files.
GET/api/v1/knowledge-bases/{name}/files/{file_id}agents:readRead file metadata.
POST/api/v1/knowledge-bases/{name}/filesagents:writeUpload and index a file.
DELETE/api/v1/knowledge-bases/{name}/files/{file_id}agents:writeDelete a file and its indexed chunks.

The agent-scoped compatibility routes remain available for existing integrations:

MethodPathScopePurpose
GET/api/v1/agents/{name}/knowledge/statusagents:readRead the agent’s knowledge status.
GET/api/v1/agents/{name}/knowledge/filesagents:readList agent-scoped files.
POST/api/v1/agents/{name}/knowledge/filesagents:writeUpload a file through the compatibility surface.
DELETE/api/v1/agents/{name}/knowledge/files/{file_id}agents:writeDelete an agent-scoped file.

Prefer named knowledge bases for new integrations because they support many-to-many agent linking. See Knowledge.

MethodPathScopePurpose
GET/api/v1/knowledge-graphsagents:readList bundles.
GET/api/v1/knowledge-graphs/{bundle}agents:readRead bundle metadata.
GET/api/v1/knowledge-graphs/{bundle}/schemasagents:readList entity schemas.
GET/api/v1/knowledge-graphs/{bundle}/schemas/{entity_type}agents:readRead one entity schema.
PUT/api/v1/knowledge-graphs/{bundle}/schemas/{entity_type}agents:writeCreate or replace an entity schema.
GET/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}agents:readList and filter entities.
POST/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}/batch-getagents:readRead several entities by ID.
GET/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}/{id}agents:readRead one entity.
POST/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}agents:writeCreate one entity.
PUT/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}/{id}agents:writeReplace one entity.
DELETE/api/v1/knowledge-graphs/{bundle}/entities/{entity_type}/{id}agents:writeIdempotently delete one entity and report whether it existed.
POST/api/v1/knowledge-graphs/{bundle}/importagents:writeApply a complete bundle payload.
DELETE/api/v1/knowledge-graphs/{bundle}agents:writeDelete a bundle.

A bundle import is a full reconciliation: records absent from the payload are removed. Through the MCP provisioning server, importing over an existing bundle also requires replace_existing: true and a token with manage authority; use entity upserts when you intend to preserve other records. REST callers must likewise treat the import as destructive even though the REST route is guarded by agents:write.

Equality filters are coerced to the field’s declared JSON type. Invalid boolean or numeric values return 400 instead of comparing as strings. See Knowledge Graphs for payloads, all nine MCP tools, capability binding, and brewctl examples.

MethodPathScopePurpose
GET/api/v1/mcp-serversmcp:readList configured MCP servers.
POST/api/v1/mcp-serversmcp:writeCreate a server.
PUT/api/v1/mcp-servers/{name}mcp:writeFully replace a server.
PATCH/api/v1/mcp-servers/{name}mcp:writeUpdate selected server fields.
DELETE/api/v1/mcp-servers/{name}mcp:writeDelete a server.
POST/api/v1/mcp-servers/{name}/refreshmcp:writeRe-run tools/list and replace the cached catalog without reconnecting.
GET/api/v1/mcp/catalogAuthenticatedList the built-in MCP catalog.
POST/api/v1/mcp/rpcprovision or manageStreamable-HTTP JSON-RPC endpoint for coding-agent provisioning tools.

Tool-level checks on /api/v1/mcp/rpc separate non-destructive provisioning from destructive management. A provision token can list, create, and update supported resources; delete tools and destructive existing-bundle replacement require manage.

See MCP Servers and Connect a coding agent.

MethodPathScopePurpose
POST/api/v1/config/reloadconfigReload tenant configuration so externally changed resources become available without a service restart.
GET/api/v1/config/exportconfigExport YAML without secrets.
POST/api/v1/config/importconfigImport YAML configuration.
GET/api/v1/settingssettings:readList tenant settings.
PUT/api/v1/settings/{key}settings:writeUpdate one setting.

Config import and export include agents, models, MCP servers, schemas and relations, and Knowledge Graph bundles. Settings are managed through their own API and are not part of this YAML bundle. Keep secrets in the deployment secret store or Admin credential fields; exported configuration does not reveal them.

Configuration export includes every Knowledge Graph entity; brewctl kg pull still reads at most 500 entities per entity type. Import writes models, MCP servers, agents, and schemas in one transaction before applying Knowledge Graphs, so a graph error does not undo those sections.

A config file is limited to 16 MiB: a larger import body returns 413, and an export that would exceed the limit returns 409 instead of a truncated file. Import refuses YAML aliases, duplicate mapping keys, and mappings with more than 256 keys with 400 naming the line, and refuses agents that reference unknown tools or MCP servers with 400. A second concurrent import or export for the same workspace returns 429. See Import and export limits.

See Configuration management and Settings and BYOK.

MethodPathScopePurpose
GET/api/v1/auditaudit:readQuery the audit log and filters.
GET/api/v1/audit/tool-callsAuthenticatedQuery paginated tool-call events.
GET/api/v1/usageAuthenticatedRead the usage totals available for the current deployment.
GET/api/v1/admin/usage-limitsadminList configured tenant and per-user usage limits.
PUT/api/v1/admin/usage-limitsadminCreate or replace one usage-limit scope.
DELETE/api/v1/admin/usage-limits/{scope}adminRemove the tenant or per_user limit.
GET/api/v1/tools/metadatatools:readList built-in tool metadata.
GET/api/v1/resilience/circuit-breakersresilience:readList circuit-breaker states.
POST/api/v1/resilience/circuit-breakers/{name}/resetresilience:writeReset a circuit breaker.
GET/metricsEnterprise deploymentRead Prometheus-format metrics when enabled for the deployment.

Tool-call filters are session_id, agent, tool, status, user_id, from, to, page, and per_page; its default page size is 50 and maximum is 100. Protect /metrics with network policy or a reverse proxy.

Usage limits are operator controls rather than request-rate counters. See Usage limits for their rolling-window semantics and 402 behavior.

SyntheticBrew does not expose a rate-limit usage route. Cloud traffic limits are managed by SyntheticBrew, while Enterprise administrators configure request limits at their ingress or reverse proxy.

Errors use an appropriate HTTP status and a JSON error body. Common statuses are 400 for invalid input, 401 for missing authentication, 403 for insufficient scope, 404 for unavailable resources or resources not visible to the caller, 409 for state conflicts, 413 for an oversized body, and 429 when a bounded operation cannot start now: a config import, config export, or Knowledge Graph bundle import already running for the workspace, or a full document indexing queue. Retry a 429 after the running work finishes.

Unless a section states otherwise:

  • POST creates or performs an explicit action;
  • PUT is a full replacement and requires the resource’s required fields;
  • PATCH changes only supplied fields;
  • successful DELETE operations may return an empty response;
  • names in URL paths are stable resource names, while {id}, {relationId}, {capId}, file_id, and entry_id are identifiers returned by the API.