Skip to content

REST API

Every route answers with and without a trailing slash. Errors are {"detail": ...}.

Requests under /api/ are authenticated in this order:

  1. Authorization: Bearer <access token>
  2. the access_token_lf cookie
  3. the x-api-key header or query parameter

API keys belong to users and act as their owner. Missing credentials answer 401, or 403 on run, webhook, workflow and MCP routes. With auto-login on (the default on loopback binds), requests without credentials run as the superuser.

Every resource is scoped to its owner. Another user’s id answers 404.

curl -X POST 'http://localhost:7860/api/v1/run/<flow id or endpoint name>' \
-H 'Content-Type: application/json' \
-H 'x-api-key: <your API key>' \
-d '{"input_value": "Hello", "input_type": "chat", "output_type": "chat", "session_id": "my-session"}'
  • GET /health (liveness) and GET /health_check (runs SELECT 1; 503 when the database fails)
  • GET /api/v1/all (the component catalog), /api/v1/version, /api/v1/config
  • POST /api/v1/login (form username, password), GET /api/v1/auto_login, POST /api/v1/refresh, GET /api/v1/session, POST /api/v1/logout
  • POST /api/v1/users/ (sign-up when enabled; superusers always), GET /api/v1/users/whoami, GET /api/v1/users/ (superuser), GET/PATCH/DELETE /api/v1/users/{id}, PATCH /api/v1/users/{id}/reset-password
  • GET/POST /api/v1/api_key/ (optional expires_at), DELETE /api/v1/api_key/{id}
  • GET/POST /api/v1/flows/, GET/PATCH/PUT/DELETE /api/v1/flows/{id}. If-Match: <version_token> is honoured, and a mismatch answers 412.
  • POST /api/v1/flows/batch/, DELETE /api/v1/flows/ (a list of ids)
  • POST /api/v1/flows/upload/ (JSON or ZIP), POST /api/v1/flows/download/ (one id gives JSON, several give a ZIP)
  • /api/v1/projects/ and /api/v1/folders/: list, create, GET/PATCH/DELETE /{id}, /download/{id} (ZIP), /upload/
  • Versions: GET/POST /api/v1/flows/{id}/versions/, GET/DELETE /versions/{vid}, POST /versions/{vid}/activate, GET /flows/{id}/version-state, POST /flows/{id}/fork, POST /flows/{id}/overwrite (needs If-Match)
  • Starters: GET /api/v1/starter-projects/, GET /api/v1/flows/basic_examples/
  • POST /api/v1/run/{flow_id_or_endpoint} with input_value, input_type, output_type, output_component, session_id, tweaks. ?stream=true returns text/event-stream ending in end{result}.
  • POST /api/v1/webhook/{id} answers 202. The raw body goes into every Webhook node as its data, and the flow runs in the background.
  • POST /api/v1/build/{id}/flow returns {job_id} (start_component_id, stop_component_id). Then GET /api/v1/build/{id}/events (NDJSON) and POST /api/v1/build/{id}/cancel.
  • POST /api/v2/workflows with mode sync, stream or background, and stream_protocol langflow (SSE) or agui. Also GET /api/v2/workflows?job_id=, POST /api/v2/workflows/stop and GET /api/v2/workflows/{job_id}/events. Stream and background jobs are durable: status, outputs and events survive a restart, with Last-Event-ID replay.
  • Human in the loop: GET /api/v2/workflows/pending, POST /api/v2/workflows/{job_id}/resume. See Human in the loop.
  • POST /api/v1/responses, an OpenAI Responses-style endpoint where model is a flow id or endpoint name.
  • GET/POST /api/v1/variables/, PATCH/DELETE /api/v1/variables/{id}, POST /api/v1/variables/detections. Credential values are never returned.
  • Files v2: POST/GET/DELETE /api/v2/files, GET/PUT/DELETE /api/v2/files/{id}, POST/DELETE /api/v2/files/batch/
  • Files v1 per flow: /api/v1/files/{upload,list,download,images,delete}/...
  • GET/DELETE /api/v1/monitor/messages, /messages/sessions, PUT /messages/{id}, PATCH/DELETE /messages/session/{id}
  • GET/DELETE /api/v1/monitor/builds?flow_id=, GET /api/v1/monitor/transactions?flow_id=, GET /api/v1/monitor/job_queue
  • GET/DELETE /api/v1/monitor/traces, GET/DELETE /api/v1/monitor/traces/{id}
  • GET /api/v1/flows/public_flow/{id} (no auth; PUBLIC flows only)
  • POST /api/v1/build_public_tmp/{flow}/flow, GET /api/v1/build_public_tmp/{job}/events (anonymous client_id cookie, 10 starts per minute)
  • GET /api/v1/monitor/messages/shared, /shared/sessions, PUT /shared/{id}, PATCH/DELETE /shared/session/{id}, POST /api/v2/workflows/public
  • GET /api/v1/webhook-events/{flow} (SSE)
  • MCP server: POST /api/v1/mcp/streamable, legacy SSE GET /api/v1/mcp/sse + POST /api/v1/mcp/?session_id=, and per project /api/v1/mcp/project/{id}, /sse, /streamable. See MCP.
  • MCP server configs: GET /api/v2/mcp/servers?action_count=, GET/POST/PATCH/DELETE /api/v2/mcp/servers/{name}
  • A2A: GET /api/v1/a2a/agents, GET /api/v1/a2a/{flow}/.well-known/agent-card.json, POST /api/v1/a2a/{flow}/jsonrpc
  • GET /api/v1/models (filters provider, model_type, tool_calling, reasoning), /models/providers, /provider-descriptors, /provider-variable-mapping, /enabled_providers
  • GET/POST /api/v1/models/enabled_models, GET/POST/DELETE /api/v1/models/default_model, GET /api/v1/model_options/{language,embedding}

Model lists come from a bundled catalog. There is no live model discovery for Ollama or OpenAI-compatible servers.

  • GET/POST/DELETE /api/v1/knowledge_bases, POST /preview-chunks, GET/DELETE /{name}, GET /{name}/chunks, POST /{name}/ingest (multipart), GET /{name}/runs, /runs/{id}, POST /{name}/cancel
  • GET/POST /api/v1/memories?flow_id=, GET/PATCH/DELETE /{id}, GET /{id}/sessions, /{id}/messages, POST /{id}/flush, GET /{id}/mismatch, POST /{id}/regenerate
  • GET /api/v1/triggers?flow_id=, POST, GET/PATCH/DELETE /{id}, /{id}/enable, /disable, /pin, /events, /replay, /test, /ingress, /signing-secret
  • Ingress (anonymous): POST /api/v1/triggers/ingress/webhook/{public_id}, signed with X-Signature. Every refusal answers 404. There is no rate limit on this route yet.

Schedule Trigger and Inbound Webhook Trigger nodes become trigger rows when you save the flow. A row stays pending until you enable it.

  • POST /api/v1/custom_component, POST /api/v1/custom_component/update
  • POST /api/v1/validate/code (answers “not supported” unless the Python bridge is on), POST /api/v1/validate/prompt
  • /store, voice, and authorization or enterprise routes
  • POST /models/validate-provider
  • the deprecated per-vertex build endpoint
  • MCP resources and prompts, and the MCP install and composer routes
  • AG-UI replay of jobs that are no longer in memory

Weftra is open source under Apache-2.0. Made by Liceron.