Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTTP API

Everything the web UI does goes through a versioned REST API under /api/v1. You can use the same API to manage workflows, credentials and executions from scripts and other systems.

OpenAPI description

The API is described by an OpenAPI 3.1 document:

  • Served by every instance at GET /api/v1/openapi.json.
  • Published with this documentation as api/openapi.json, generated from the same route table when the book is built.
  • Every route, its summary and the permission it checks are listed on the endpoint index.

Load it into any OpenAPI viewer or client generator. The document is generated from the server’s route table, so it always matches the version that serves it.

Authentication

MethodUse
API keyScripts, CI, MCP clients. Send Authorization: Bearer <key>. Create keys under Settings > API keys or with POST /api/v1/api-keys. Keys are hashed at rest, can be scoped and can expire.
Session cookieThe web UI. Cookie-authenticated requests that change state must send the CSRF token header.

Every route requires a permission, checked against the caller’s instance role and project role. See Users, roles and SSO.

export BASE_URL=https://automation.example.com
export API_KEY=...   # from Settings > API keys

curl -s "$BASE_URL/api/v1/workflows" -H "authorization: Bearer $API_KEY"

Main resources

PathPurpose
/api/v1/workflowsList, create, update, delete workflows; versions and rollback
/api/v1/workflows/{id}/activate, /deactivateActivation
/api/v1/workflows/{id}/runStart a manual execution
/api/v1/workflows/import/n8nImport n8n-format JSON, returns the diagnostics report
/api/v1/workflows/{id}/export/n8nExport in n8n format
/api/v1/executionsList and inspect executions, per-node run data
/api/v1/executions/{id}/retry, /cancelRetry from the failed node, cancel
/api/v1/executions/{id}/streamLive events over Server-Sent Events
/api/v1/credentialsCredentials (secret fields are write-only), test, OAuth2 connect
/api/v1/connectorsConnector catalog and lookups (/connectors/{id}/lookups/{lookup})
/api/v1/node-typesNode descriptors used by the editor
/api/v1/projectsProjects, members, variables
/api/v1/users, /api/v1/api-keysUsers and API keys
/api/v1/auditAudit log

Endpoints outside /api/v1

PathPurpose
/webhook/<path>Production webhooks of active workflows
/webhook-test/<path>Test webhooks while the editor is listening
/webhook-waiting/<token>Resume URLs of waiting executions
/form/<path>Hosted forms (form triggers and Wait-for-form)
/mcpMCP server endpoint (Streamable HTTP) for workflows exposed as tools
/healthzLiveness and readiness check, no authentication
/metricsPrometheus metrics (see Metrics)

Streaming execution events

GET /api/v1/executions/{id}/stream returns text/event-stream. Events:

EventData
node_startedNode name, run index
node_finishedNode name, run index, item counts per output
node_failedNode name, run index, redacted error
execution_finishedFinal status

When a client connects, past events of the execution are replayed first, so a client that connects late still sees the whole run. Reverse proxies must not buffer this endpoint; see the proxy examples in Deployment.

Conventions

  • Request and response bodies are JSON. Timestamps are RFC 3339 in UTC.
  • List endpoints are paginated with limit and an opaque cursor; the response includes next_cursor when there are more results.
  • Errors use a consistent body with a machine-readable code and a human message. Secret values never appear in errors.
  • Breaking changes go to a new version prefix. Additive changes (new fields, new endpoints) can appear in any release; clients should ignore unknown fields.