API Reference

Complete reference for the Synth server REST API. The server runs on port 9410 by default. All request and response bodies use JSON (Content-Type: application/json).

Authentication: All endpoints except GET /health and GET /api/auth/status require a valid JWT token. Pass it via the Authorization: Bearer <token> header. Obtain a token from the POST /api/auth/login endpoint, or create a scoped API key via POST /api/auth/api-keys.

Health & System

MethodPathAuthDescription
GET/healthNoneHealth check — returns server status, uptime, and component checks
GET/api/health/llmTokenLLM connectivity status and model info
POST/api/health/llm/verify-taskTokenRun a verification task against the LLM to confirm end-to-end connectivity
GET/api/system/stateTokenSystem state overview — entity counts, active deployments, agent status
# Basic health check (no auth required)
curl http://localhost:9410/health

# LLM connectivity status
curl http://localhost:9410/api/health/llm \
  -H "Authorization: Bearer eyJhbG..."

Authentication

Synth uses JWT-based authentication. Access tokens are short-lived; refresh tokens allow obtaining new access tokens without re-authenticating. The JWT signing secret is configured via the SYNTH_JWT_SECRET environment variable.

MethodPathAuthDescription
GET/api/auth/statusNoneAuth configuration status — whether auth is enabled, available providers
POST/api/auth/registerNoneRegister a new user account
POST/api/auth/loginNoneAuthenticate and receive JWT access + refresh tokens
POST/api/auth/refreshRefresh tokenExchange a refresh token for a new access token
POST/api/auth/logoutTokenInvalidate tokens and end the session
GET/api/auth/meTokenCurrent user profile
PUT/api/auth/meTokenUpdate current user profile
POST/api/auth/me/passwordTokenChange current user's password
GET/api/auth/sessionsTokenList active sessions for the current user
DELETE/api/auth/sessions/:idTokenRevoke a specific session
DELETE/api/auth/sessionsTokenRevoke all sessions (force re-login everywhere)
GET/api/auth/providersNoneList available authentication providers (for IdP integration)

Login Example

curl -X POST http://localhost:9410/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "admin",
    "password": "your-password"
  }'

# Response:
# {
#   "accessToken": "eyJhbG...",
#   "refreshToken": "eyJhbG...",
#   "user": { "id": "...", "username": "admin", "role": "admin" }
# }

API Keys

API keys provide long-lived, scoped authentication for CI/CD pipelines and programmatic access. Each key has a specific set of permissions, limiting what it can do.

MethodPathAuthDescription
GET/api/auth/api-keysTokenList all API keys for the current user
POST/api/auth/api-keysTokenCreate an API key with scoped permissions
DELETE/api/auth/api-keys/:idTokenDelete an API key
POST/api/auth/api-keys/:id/regenerateTokenRegenerate an API key (invalidates the previous value)

Creating a Scoped API Key

# Create a scoped API key
curl -X POST http://localhost:9410/api/auth/api-keys \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbG..." \
  -d '{
    "name": "ci-pipeline",
    "permissions": ["deployment.create", "deployment.view", "artifact.create"]
  }'

# Use the API key
curl http://localhost:9410/api/operations \
  -H "Authorization: Bearer synth_key_..."

Artifacts

MethodPathPermissionDescription
GET/api/artifactsartifact.viewList artifacts — deployment-ready packages, images, or bundles
POST/api/artifactsartifact.createRegister a new artifact

Operations

MethodPathPermissionDescription
POST/api/operationsdeployment.createCreate and dispatch a new operation (deploy, maintain, query, investigate, trigger)
GET/api/operationsdeployment.viewList operations — supports filtering by status, type, partition, environment
GET/api/debriefdeployment.viewQuery debrief entries — the decision log for agent actions

Create an Operation

curl -X POST http://localhost:9410/api/operations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbG..." \
  -d '{
    "artifactId": "art_abc123",
    "envoyId": "envoy-prod-01",
    "environmentId": "env_production",
    "partitionId": "part_main",
    "variables": {
      "APP_VERSION": "2.4.1",
      "REPLICAS": "3"
    }
  }'

List Operations

# List all operations
curl http://localhost:9410/api/operations \
  -H "Authorization: Bearer eyJhbG..."

# Filter by status
curl "http://localhost:9410/api/operations?status=running" \
  -H "Authorization: Bearer eyJhbG..."

# Filter by partition
curl "http://localhost:9410/api/operations?partitionId=part_main" \
  -H "Authorization: Bearer eyJhbG..."

Partitions

Partitions are optional logical groupings with scoped variables and constraints. Deployments work with or without partition context.

MethodPathPermissionDescription
GET/api/partitionspartition.viewList all partitions
POST/api/partitionspartition.createCreate a new partition

Environments

MethodPathPermissionDescription
GET/api/environmentsenvironment.viewList environments (staging, production, etc.)
POST/api/environmentsenvironment.createCreate a new environment

Envoys

Envoys are lightweight deployment agents running on target machines. The server manages envoy registration, health monitoring, and token rotation.

MethodPathPermissionDescription
GET/api/envoysenvoy.viewList all registered envoys
POST/api/envoysenvoy.registerRegister a new envoy
GET/api/envoys/:id/healthenvoy.viewGet health status for a specific envoy
PUT/api/envoys/:idenvoy.configureUpdate envoy configuration
DELETE/api/envoys/:idenvoy.configureUnregister and remove an envoy
POST/api/envoys/:id/rotate-tokenenvoy.configureRotate the envoy's authentication token
GET/api/envoys/:id/knowledgeenvoy.viewRetrieve the envoy's knowledge store (cached environment data)
POST/api/envoys/validate-tokenTokenValidate an envoy authentication token

Agent (Intelligence)

The agent is Synth's reasoning core. It generates deployment plans and produces pre-flight analyses. These endpoints require a configured LLM connection (SYNTH_LLM_API_KEY).

MethodPathAuthDescription
GET/api/agent/contextTokenAgent context summary — current state the agent is reasoning about
POST/api/agent/pre-flightTokenGenerate a pre-flight analysis for a planned deployment
POST/api/agent/pre-flight/responseTokenSubmit a user response to pre-flight questions or confirmations

Settings

MethodPathPermissionDescription
GET/api/settingssettings.manageGet current application settings
PUT/api/settingssettings.manageUpdate application settings (partial updates supported)
GET/api/settings/command-infoTokenServer version, build info, and runtime metadata

Users & Roles

MethodPathPermissionDescription
GET/api/usersusers.manageList all users
POST/api/usersusers.manageCreate a new user
GET/api/rolesusers.manageList all roles and their permissions
POST/api/rolesroles.manageCreate a new role with specific permissions

Telemetry

MethodPathPermissionDescription
GET/api/telemetrysettings.manageQuery telemetry events — deployment metrics, agent usage, system performance

Fleet Deployment

Fleet endpoints coordinate deployments across multiple envoys simultaneously.

MethodPathAuthDescription
POST/api/fleet/deployTokenTrigger a fleet-wide deployment to multiple envoys
GET/api/fleet/deploymentsTokenList fleet deployments and their per-envoy status

Deployment Graphs

Deployment graphs define multi-step, dependency-aware deployment workflows as directed acyclic graphs.

MethodPathAuthDescription
POST/api/graphsTokenCreate a new deployment graph
GET/api/graphsTokenList all deployment graphs
GET/api/graphs/:idTokenGet full graph detail including nodes and edges
PUT/api/graphs/:idTokenUpdate a deployment graph
DELETE/api/graphs/:idTokenDelete a deployment graph

Intake (CI/CD Webhooks)

Intake channels receive webhooks from CI/CD systems to automatically trigger deployments when builds complete.

MethodPathAuthDescription
GET/api/intake/channelsTokenList configured intake channels
POST/api/intake/channelsTokenCreate a new intake channel (returns a webhook URL)

Each intake channel provides a webhook URL specific to the CI/CD provider. Supported providers: GitHub Actions, GitLab CI, Azure DevOps, Jenkins, and CircleCI.

MCP Server

Synth exposes a Model Context Protocol server, making deployment operations available as tools for any MCP-compatible AI client.

MethodPathAuthDescription
POST/mcpTokenMCP JSON-RPC endpoint — send tool calls and receive results
GET/mcpTokenMCP Server-Sent Events endpoint — streaming responses
DELETE/mcpTokenClose an active MCP session

MCP sessions have a configurable TTL (default: 1 hour, set via SYNTH_MCP_SESSION_TTL_MS). Idle sessions are cleaned up automatically.

Permissions Reference

Permissions are assigned to roles, and roles are assigned to users. API keys can be scoped to a subset of the creating user's permissions.

PermissionGrants access to
artifact.viewList and read artifacts
artifact.createRegister new artifacts
deployment.viewList deployments and query debriefs
deployment.createCreate and dispatch deployments
partition.viewList partitions
partition.createCreate partitions
environment.viewList environments
environment.createCreate environments
envoy.viewList envoys and view health/knowledge
envoy.registerRegister new envoys
envoy.configureUpdate, remove, and rotate envoy tokens
settings.manageRead and update application settings, query telemetry
users.manageList and create users, list roles
roles.manageCreate and modify roles

Error Responses

All error responses follow a consistent format:

{
  "error": "Short error code",
  "message": "Human-readable description of what went wrong"
}
StatusMeaning
400Bad request — invalid or missing parameters
401Unauthorized — missing or invalid token
403Forbidden — valid token but insufficient permissions
404Not found — entity does not exist
409Conflict — entity already exists or state conflict
429Rate limited — too many requests (see SYNTH_RATE_LIMIT_MAX)
500Internal server error — check server logs

Rate Limiting

The server enforces per-IP rate limiting. Defaults: 100 requests per 60-second window. Configure via environment variables:

  • SYNTH_RATE_LIMIT_MAX — maximum requests per window (default: 100)
  • SYNTH_RATE_LIMIT_WINDOW_MS — window duration in milliseconds (default: 60000)

When rate limited, the server returns 429 Too Many Requests with a Retry-After header.