HTTP API
The Engine HTTP API powers the Web UI and can be used to build custom integrations. It’s a REST API with Server-Sent Events (SSE) for streaming responses.
Base URL
Section titled “Base URL”http://localhost:3000/apiWhen running the Web UI image, the API is proxied through SvelteKit. When running --http-api only, it defaults to port 3100.
Authentication
Section titled “Authentication”In single-user mode (default), no authentication is required. The API is intended for local use only.
Endpoints
Section titled “Endpoints”Health
Section titled “Health”GET /healthGET /api/healthReturns {"status":"ok"}. No auth required, useful for Docker health checks.
Sessions
Section titled “Sessions”POST /api/sessions # Create a new sessionDELETE /api/sessions/:id # Delete a sessionPOST /api/sessions/:id/run # Run a task (SSE streaming response)GET /api/sessions/:id/pending-prompt # Check for a resumable promptPOST /api/sessions/:id/reply # Reply to a pending promptPOST /api/sessions/:id/abort # Abort a running taskPOST /api/sessions/:id/compact # Compact context windowRunning a task (SSE)
Section titled “Running a task (SSE)”curl -N -X POST http://localhost:3000/api/sessions/{id}/run \ -H "Content-Type: application/json" \ -d '{"task": "What is the weather in Munich?"}'The response is a Server-Sent Events stream with these event types:
| Event | Description |
|---|---|
text | Streamed response text chunk |
thinking | Extended thinking summary |
tool_call | Tool invocation (name, input) |
tool_result | Tool result (output, success) |
prompt | Agent requests user input (ask_user). Includes promptId for resumable prompts |
secret_prompt | Agent requests a secret (ask_secret). Includes promptId |
turn_end | Turn completed |
changeset_ready | File changes pending review (accept/rollback) |
done | Run completed |
error | Error occurred |
Threads
Section titled “Threads”GET /api/threads # List threadsGET /api/threads/:id # Get thread detailsPATCH /api/threads/:id # Update (rename, archive)DELETE /api/threads/:id # Delete threadGET /api/threads/:id/messages # Get messages (supports pagination)Memory
Section titled “Memory”GET /api/memory/:ns # Read namespace (knowledge|methods|status|learnings)PUT /api/memory/:ns # Replace namespace contentPOST /api/memory/:ns/append # Append to namespacePATCH /api/memory/:ns # Update (old/new text)DELETE /api/memory/:ns # Delete entries (pattern query param)Secrets
Section titled “Secrets”GET /api/secrets # List secret namesGET /api/secrets/status # Secret status overviewPUT /api/secrets/:name # Store a secretDELETE /api/secrets/:name # Delete a secretResumable Prompts
Section titled “Resumable Prompts”Prompts (ask_user and ask_secret) are persisted in SQLite and survive SSE disconnects, page refreshes, and thread switches. The agent polls the database for answers instead of holding an in-memory callback.
- Agent calls
ask_userorask_secret→ prompt written to SQLite with apromptId - SSE event sent to client (best-effort — client may not be connected)
- Agent polls SQLite every 2s for an answer
- If client disconnects, the agent loop stays alive (polling is near-zero CPU)
- Client reconnects →
GET /api/sessions/:id/pending-prompt→ sees the prompt - Client replies →
POST /api/sessions/:id/replywithpromptId→ answer written to SQLite - Agent picks up answer on next poll → resumes execution
Prompts expire after 24 hours. On engine restart, all pending prompts are expired.
Checking for pending prompts
Section titled “Checking for pending prompts”GET /api/sessions/:id/pending-promptReturns {"pending": false} or the full prompt data:
{ "pending": true, "promptId": "uuid", "promptType": "ask_user", "question": "Shall I create the task?", "options": ["Yes", "No"], "timeoutMs": 86400000, "createdAt": "2026-04-03T23:30:00Z"}Replying to prompts
Section titled “Replying to prompts”Include promptId for idempotent replies (prevents double-answer race conditions):
POST /api/sessions/:id/replyBody: {"answer": "Yes", "promptId": "uuid"}Secret Prompt (SSE)
Section titled “Secret Prompt (SSE)”During a run, the agent may request a secret via the ask_secret tool. This triggers a secret_prompt SSE event:
event: secret_promptdata: {"promptId":"uuid","name":"STRIPE_API_KEY","prompt":"Enter your Stripe API key","key_type":"stripe"}The client stores the secret directly via PUT /api/secrets/:name (the value never enters the SSE stream), then confirms:
POST /api/sessions/:id/secret-savedBody: {"saved": true, "promptId": "uuid"}Config
Section titled “Config”GET /api/config # Get config (secrets redacted)PUT /api/config # Update configHistory & Analytics
Section titled “History & Analytics”GET /api/history/runs # List runs (filterable)GET /api/history/runs/:id # Run detailsGET /api/history/runs/:id/tool-calls # Tool calls for a runGET /api/history/stats # Aggregated statisticsGET /api/history/cost/daily # Daily cost breakdownKnowledge Graph
Section titled “Knowledge Graph”GET /api/kg/stats # Graph statisticsGET /api/kg/entities # List/search entitiesGET /api/kg/entities/:id # Entity details + relationsGET /api/tasks # List tasksPOST /api/tasks # Create taskPATCH /api/tasks/:id # Update taskDELETE /api/tasks/:id # Delete taskPOST /api/tasks/:id/complete # Mark completeArtifacts
Section titled “Artifacts”GET /api/artifacts # List artifactsPOST /api/artifacts # Save artifactGET /api/artifacts/:id # Get artifactDELETE /api/artifacts/:id # Delete artifactGET /api/crm/contacts # List contactsGET /api/crm/contacts/:name/interactions # Contact historyGET /api/crm/contacts/:name/deals # Contact dealsGET /api/crm/deals # List dealsGET /api/crm/stats # CRM statisticsIntegrations
Section titled “Integrations”GET /api/google/status # Google auth statusPOST /api/google/auth # Start device flowPOST /api/google/revoke # Revoke authPOST /api/google/reload # Reload Google integrationGET /api/google/oauth-url # Get OAuth start URL (managed hosting)POST /api/google/claim-managed # Claim tokens from control plane (managed hosting)
POST /api/searxng/check # Validate SearXNG URLBackups
Section titled “Backups”GET /api/backups # List backupsPOST /api/backups # Create backupPOST /api/backups/:id/restore # Restore backupGET /api/files # List directoryGET /api/files/download # Download fileGET /api/files/read # Read file preview (max 1 MB)DELETE /api/files # Delete fileWorkflows
Section titled “Workflows”GET /api/workflows # List workflow runsGET /api/workflows/:id # Workflow detailsGET /api/workflows/:id/steps # Workflow step resultsGET /api/workflows/stats/steps # Step statisticsGET /api/workflows/stats/cost # Workflow cost statsDataStore
Section titled “DataStore”GET /api/datastore/collections # DataStore collectionsGET /api/datastore/:collection # Collection recordsGET /api/vault/key # Retrieve vault keyPOST /api/vault/rotate # Rotate vault keyGET /api/auth/token # Generate/retrieve auth tokenGDPR / Data
Section titled “GDPR / Data”GET /api/export # Data export (Art. 15 + Art. 20)DELETE /api/data # Data deletion (Art. 17)Migration
Section titled “Migration”Zero-knowledge self-hosted→managed transfer via X25519 ECDH + AES-256-GCM.
GET /api/migration/preview # Preview available databases and sizesPOST /api/migration/export # Start migration export (SSE streaming)GET /api/migration/handshake # Initiate ECDH key exchange (import side)POST /api/migration/handshake # Complete ECDH key exchange (import side)POST /api/migration/manifest # Receive migration manifestPOST /api/migration/chunk # Receive encrypted data chunkPOST /api/migration/restore # Restore imported dataChangeset Review
Section titled “Changeset Review”GET /api/sessions/:id/changeset # Pending file changesPOST /api/sessions/:id/changeset/review # Accept/rollback file changesPOST /api/transcribe # Transcribe audio (base64)GET /api/thread-insights # Thread analyticsGET /api/patterns # Detected patternsGET /api/metrics # Metrics dataGET /api/api-profiles # API Store profilesGET /api/api-profiles/:id # Individual API profile