SynapseOrch 2.0 is a release candidate; the stable release is 1.9.3. How to try 2.0

REST API Reference

SynapseOrch exposes a REST API for integrating agents and orchestrations into external applications. All endpoints require an API key for authentication.

Base URL

The API lives at /api/v1 and /api/v2 under one origin:

WhereOrigin
Self-hostedhttp://localhost:3000 — your SynapseOrch address and the web UI's port
SynapseOrch Cloudhttps://api.synapseorch.com

The examples on these pages use http://localhost:3000; put your origin in its place. A self-hosted install serves the API through the web UI's port, which forwards /api/v1 and /api/v2 to the backend. Where you can reach the backend directly, http://localhost:8765/api/v1 works too (8765, or your SYNAPSE_BACKEND_PORT); the Docker images bind the backend to 127.0.0.1.

The CLI takes the origin alone, in SYNAPSE_API_URL, and adds the path itself.

Authentication

Every /api/v1 and /api/v2 endpoint requires an API key as a Bearer token:

Authorization: Bearer sk-syn-...

A missing, invalid or revoked key returns 401 with Invalid or revoked API key. The key goes in that header only: an API key in the URL (?token=…) is refused, so read a stream with fetch rather than a browser EventSource, which cannot send the header.

Synapse's own MCP endpoint, /api/v1/mcp, takes the same key.

Generating API keys

Go to Settings → API keys, enter a name for the key (e.g. "Slack Bot") and click Generate — or run synapse api-keys generate <name>. On SynapseOrch Cloud, owners and admins create keys under Settings → Developer — see API keys and the Developer page for what a Cloud key can and cannot reach. The key — sk-syn- followed by 32 hex characters — is shown once; copy it then.

SynapseOrch stores only a SHA-256 hash of each key, in its database, so a lost key can't be recovered: delete it and generate another.

The screens, step by step: The public API, in the Guides.

Content type

All request bodies must be JSON:

Content-Type: application/json

Response format

Responses are JSON, except the /stream endpoints, which return text/event-stream: data: {…} lines, plus a : ping comment line after 10 seconds without an event. SSE clients ignore comment lines; if you parse the stream yourself, skip lines that start with :.

Errors follow this format:

{
  "detail": "Error message describing what went wrong"
}

Endpoints — /api/v1

V1 runs everything in the API process, and its run and chat calls either wait for the result or stream it. The work belongs to the server, not the request: a caller that stops waiting or reading leaves it running to the end — cancel it to stop it.

MethodPathDescriptionReference
POST/chatSynchronous chatPOST
POST/chat/streamSSE streaming chatPOST
POST/chat/{session_id}/cancelStop a chat turnPOST
POST/chat/{session_id}/approveAnswer the tool call a turn stopped on, and carry it on (SSE)POST
GET/agentsList agents, without Synapse AI's ownGET
GET/agents/{agent_id}Get agent detailsGET
GET/orchestrationsList the workspace's workflows, without Synapse AI's ownGET
GET/orchestrations/{orch_id}Get a workflow's definitionGET
POST/orchestrations/{orch_id}/runRun workflow (sync)POST
POST/orchestrations/{orch_id}/run/streamRun workflow (SSE)POST
GET/orchestrations/runsRecent runs, newest first, by status or workflowGET
GET/orchestrations/runs/{run_id}A run's state, and its result once it has endedGET
GET/orchestrations/runs/{run_id}/eventsThe run's events, as JSONGET
GET/orchestrations/runs/{run_id}/events/streamThe run's events, then the run followed live (SSE)GET
POST/orchestrations/runs/{run_id}/resumeResume paused run (sync)POST
POST/orchestrations/runs/{run_id}/resume/streamResume paused run (SSE)POST
POST/orchestrations/runs/{run_id}/cancelStop a runPOST
GET, POST/schedulesList and create schedulesGET · POST
GET, PATCH, DELETE/schedules/{schedule_id}Read, change or delete a schedule — {"enabled": false} pauses itGET · PATCH · DELETE
POST/schedules/{schedule_id}/runRun a schedule now, as a testPOST
POST/mcpSynapse's own MCP server—
GET, POST, PATCH, DELETE/knowledge/…Knowledge bases: bases, uploads, records, web pages, documents and searchKnowledge
GET, POST, PATCH, DELETE/webhooks/…SynapseOrch Cloud: webhook endpointsWebhooks

See Chat API, Workflows API, Knowledge API and Webhooks. Each endpoint's page in the reference — under Reference: v1 in the sidebar — has its fields, every answer and samples in cURL, JavaScript, Python and Go.

Endpoints — /api/v2

V2 queues work for scale mode workers and answers at once. On a self-hosted install without scale mode, every V2 endpoint returns 503; SynapseOrch Cloud always serves it. Like v1, it does not list, serve or run Synapse AI's own workflow, nor read its runs. Each endpoint's page is under Reference: v2 in the sidebar.

MethodPathDescriptionReference
GET/orchestrations, /orchestrations/{orch_id}List and get workflowslist · get
POST/orchestrations/{orch_id}/runQueue a run — 202 with run_id, stream_url, status_urlPOST
GET/orchestrations/runsSynapseOrch Cloud: recent runs, newest first, by status or workflowGET
GET/orchestrations/runs/{run_id}/statusRun statusGET
GET/orchestrations/runs/{run_id}/streamSSE stream, resumable with Last-Event-IDGET
GET/orchestrations/runs/{run_id}/eventsThe run's stored events, as JSONGET
POST/orchestrations/runs/{run_id}/cancelCancel a runPOST
POST/orchestrations/runs/{run_id}/resumeResume a paused run — 202POST
GET/agents, /agents/{agent_id}List and get agentslist · get
POST/chatQueue an agent chat turn — 202 with session_id; an unknown agent is a 404 before anything is queuedPOST
GET/chat/{session_id}/stream, /status, /eventsFollow a chat sessionstream · status · events
POST/chat/{session_id}/cancelCancel a chat turnPOST
GET/workers, /queue/statsWorker registry and queue statistics — self-hosted onlyworkers · stats

Run and resume requests accept webhook_url and webhook_secret to be called back when the run ends. See Scale Architecture for the full round trip. A chat request accepts them too: the callback carries status completed with the answer, or failed with The agent encountered an error processing your request. when the turn failed — its model's own error included, which is never sent as the answer.

The run stream is resumable with Last-Event-ID; read it with fetch and the Authorization header, never a browser EventSource with the key in the URL, which is a 401. A chat stream's or events' error says which kind of failure it was — the model's quota, a refusal, a rate limit, an outage, or no usable answer — and never passes on the provider's own words. /chat/{session_id}/status returns the conversation's messages; an assistant message may carry reasoning and thoughts, lists of the newest 20 of each, each at most 4,000 characters.

Agent resolution

The chat endpoints of both /api/v1 and /api/v2 accept an optional agent parameter (name or ID). It is matched in this order:

  1. Exact ID match
  2. Exact name match, ignoring case

Anything else — a partial or misspelt name — returns 404; there is no fallback to another agent. With no agent given, the workspace's first agent, the oldest in the store, answers. Synapse AI's own agents are never chosen or matched, and GET /api/v1/agents does not list them.

Rate limits

On a self-hosted install, /api/v1 does not enforce rate limits — limits are determined by your model provider's quotas. /api/v2 run submissions are limited per tenant (1,000 per second by default) and return 429 above it, as they do when 1,000 runs are already queued, running or paused; a nested run counts as part of the run that started it. A full queue returns 503. See Configuration.

SynapseOrch Cloud limits each key to 300 requests a minute, and each organisation to 1,200. Starting work — a run, a chat turn, an answer to a paused run — has its own limit of 60 a minute per key, and a key holds at most 25 open streams. Above any of these the answer is 429 with Retry-After. Knowledge searches have their own limit, 120 a minute per key, shared with MCP's search_knowledge. A run also needs credits. One started beyond your plan's runs at once is not refused: it waits in line and reads queued, with its queue_position, until a slot frees — see Capacity. 429 then means the line itself is full.

Error codes

CodeMeaning
400Chat with no agent given, and no agents configured
401Missing, invalid or revoked API key
403SynapseOrch Cloud: a key not made with Can also build asked to change the setup — a schedule, a knowledge base, a webhook endpoint (What a key can do)
404Agent, workflow or run not found
202SynapseOrch Cloud: a synchronous /api/v1 run, answer or chat still running after 300 seconds — {"status": "running", "run_id", "status_url"}, or "queued" with queue_position for a run still waiting for a slot; the work carries on, so read it back
409A resume for a run that is not waiting for an answer, or a second answer to it queued at the same moment; /api/v1 chat: a reply is still being written in that session, or an approve for a call the conversation is not waiting on
422The request body is missing a required field, has the wrong type, or has a field the endpoint does not take (named in the error); an empty answer to a resume; an initial_state key starting with _; a chat image malformed or over the limits
429/api/v2: rate limit or queued-run limit reached; SynapseOrch Cloud: a key or organisation limit, or as many runs already waiting for a slot as the plan lets wait, with Retry-After
500An error while handling the request
503/api/v1 chat: the server is still starting; /api/v2: scale mode is not enabled, or the queue is full

On this page