API reference
Examples assume local mode on port 3000. See the overview for authentication and errors.
System
Section titled “System”GET /api/health
Section titled “GET /api/health”No sign-in needed. Returns { "ok": true, "modules": <count> }.
GET /api/system
Section titled “GET /api/system”What the dashboard needs to know about this deployment, with no secrets in it.
{ "mode": "local", "workspace": { "name": "localhost", "baseUrl": null }, "user": { "id": "local", "email": null, "name": "Local operator", "role": "admin" }, "auth": { "required": false, "methods": [] }, "ai": { "chat": "openrouter/anthropic/claude-sonnet-5.5", "search": "openrouter", "image": null, "stub": false, "moduleOverrides": {}, "limits": { "imagesPerRun": 4, "timeoutMs": 120000 } }, "connectors": { "enabled": false, "reason": "connectors need sign-in to be enabled", "mock": false }, "storage": { "database": "sqlite", "artifacts": "fs" }, "devModule": null, "version": "0.0.1", "modulesHash": "..."}mode is hosted, local or dev. auth.methods lists magic, github and firebase. modulesHash changes when the installed modules change.
Modules
Section titled “Modules”GET /api/modules
Section titled “GET /api/modules”{ "modules": [ModuleSummary] }. A summary has id, version, title, description, inputSchema and configSchema (JSON Schema), connectors, an optional ui descriptor, and stages (each with id, kind, requires, conditional, agent and gate details).
GET /api/modules/:id
Section titled “GET /api/modules/:id”One module with module (the summary), install (source, version, commit, integrity, approver and date, or null), config (the configuration view with secrets masked and an editable flag), connections (state per declared connector for the caller) and stats (total, byStatus, lastRunAt, last24h). 404 for an unknown id.
PUT /api/modules/:id/config
Section titled “PUT /api/modules/:id/config”Admin only. Replaces the workspace overrides.
curl -X PUT http://localhost:3000/api/modules/content-creator/config \ -H 'content-type: application/json' \ -d '{"values":{"brandVoice":"Plain and warm."}}'values is the complete set of overrides: keys left out revert to the deployment value. A secret sent back as the mask keeps its stored value. Returns the updated configuration view. 400 with issues when invalid, 403 for a non-admin.
POST /api/runs
Section titled “POST /api/runs”Start a run.
curl -X POST http://localhost:3000/api/runs \ -H 'content-type: application/json' \ -d '{"module":"hello","input":{"name":"Ada"}}'# {"id":"run_..."} (202)404 for an unknown module. 400 invalid input with issues when the input fails the module’s schema.
GET /api/runs
Section titled “GET /api/runs”The runs list, newest first. With no query it returns the newest 100.
| Query | Meaning |
|---|---|
status |
Comma separated: running, awaiting_gate, blocked, completed, rejected, failed |
module |
A module id |
q |
Prefix of a run id or module id (up to 64 characters) |
since |
An ISO date. Only runs created at or after it. |
before |
A cursor from a previous response |
limit |
1 to 200. Default 50 when any filter is present. |
{ "runs": [{ "id": "run_7f3a", "module_id": "hello", "module_title": "Hello module", "status": "awaiting_gate", "stage": 1, "stage_id": "choose", "stage_count": 4, "gate_title": "Pick a greeting", "error": null, "blocked_connectors": [], "created_by": "local", "created_at": "...", "updated_at": "..." }], "nextCursor": null}GET /api/runs/summary
Section titled “GET /api/runs/summary”Counts for the Overview.
{ "counts": { "running": 1, "awaiting_gate": 2, "blocked": 0, "completed": 14, "rejected": 0, "failed": 1 }, "needsYou": 2, "last24h": { "started": 6, "completed": 5, "failed": 1 }, "modules": { "hello": { "active": 1, "needsYou": 1, "failed24h": 0, "lastRunAt": "...", "lastStatus": "awaiting_gate" } }}needsYou is open gates plus blocked runs.
GET /api/runs/:id
Section titled “GET /api/runs/:id”One run, in full: run (status, stage index, input, outputs, gates (decisions by stage), the open gate, blocked, attempts, history, feedback, error, creator and times), stages (the module’s stage summaries), events (the full timeline) and artifacts (name, content type, size, time and url). 404 if unknown.
POST /api/runs/:id/gate
Section titled “POST /api/runs/:id/gate”Decide the open gate.
curl -X POST http://localhost:3000/api/runs/run_7f3a/gate \ -H 'content-type: application/json' \ -d '{"choice":"warm"}'| Body field | Meaning |
|---|---|
choice |
Required. An option id, approve or reject for approval gates, or regenerate to send the stage back. |
note |
Optional. The note that goes with a send-back, up to 2,000 characters. |
edits |
Optional. A record of strings for the gate’s editable fields, each up to 4,000 characters. |
Returns { "ok": true, "idempotent": false } with 202. Repeating the same decision returns idempotent: true with 200. A different choice after the gate was decided returns 409 already decided: <choice>. 400 for a choice that is not an option, an edit to a field the gate does not offer, a run that is not awaiting a gate, or a send-back that has reached its limit.
Inbox and activity
Section titled “Inbox and activity”GET /api/inbox
Section titled “GET /api/inbox”What waits for a person: open gates, then blocked runs, each oldest first. limit up to 200, default 100.
{ "items": [ { "kind": "gate", "runId": "run_7f3a", "moduleId": "hello", "moduleTitle": "Hello module", "stageId": "choose", "title": "Pick a greeting", "type": "pick", "optionCount": 2, "canRegenerate": false, "since": "...", "startedBy": "local" }, { "kind": "blocked", "runId": "run_b201", "moduleId": "acme-report", "moduleTitle": "Acme report", "stageId": "post", "problems": [{ "connector": "slack", "reason": "needs_reauth" }], "since": "...", "startedBy": "ada@example.com" }] }GET /api/events
Section titled “GET /api/events”Recent activity across runs, newest first: { "events": [...] }. Each event has id, runId, moduleId, type, stage, ts and a trimmed data.
| Query | Meaning |
|---|---|
limit |
1 to 200, default 50 |
before |
An event id from a previous page |
run, module |
Filter |
audit |
0 hides machine detail (connector calls, page fetches, AI calls, log and progress lines) |
The feed shows what happened, not what it was about: per type, only a few fields leave the server (for example the connector and operation of connector.call, the choice and decider of gate.decided).
Artifacts
Section titled “Artifacts”GET /api/artifacts
Section titled “GET /api/artifacts”Artifacts across runs, newest first. Query: module, run, kind (image, html, markdown, json, other), before, limit (default 48, up to 100). Returns { "artifacts": [{ name, content_type, size, updated_at, url, runId, moduleId }], "nextCursor" }. Nothing from inside the files.
GET /api/runs/:id/artifacts/:name
Section titled “GET /api/runs/:id/artifacts/:name”The file itself. The name can contain slashes (images/v1-1.svg). It is served with content-security-policy: sandbox; default-src 'none'; ... and x-content-type-options: nosniff, because artifacts are untrusted output and must never run script in the app’s origin.
GET /api/runs/:id/artifacts.zip
Section titled “GET /api/runs/:id/artifacts.zip”Every artifact of the run as one store-only zip. 404 if the run has none.
Connectors
Section titled “Connectors”GET /api/connectors
Section titled “GET /api/connectors”{ "enabled": true, "connectors": [...] } on a deployment with connectors on, as seen by the caller. Each connector has provider, title, url (MCP), configured, scopes, needs (module, name, scopes, required) and connections (id, scope of user or workspace, mine, label, status, grantedScopes, missingScopes, error, lastTest). lastTest is the stored result of the last test, { "checkedAt", "ok", "detail", "error"?, "action"? }, or null when the connection was never tested (and after it is reconnected). When connectors are off: { "enabled": false, "reason": "..." }. Under knetik dev it describes mocks.
POST /api/connectors/:provider/connect
Section titled “POST /api/connectors/:provider/connect”Body { "workspace": true|false, "url": "<mcp server url>" }. Returns { "authorizeUrl": "..." } to send the browser to. workspace: true needs an admin.
POST /api/connections/:id/disconnect
Section titled “POST /api/connections/:id/disconnect”Revokes at the provider where it can, and removes the connection. A person may disconnect their own; an admin may disconnect any. Returns { "ok": true }.
POST /api/connections/:id/test
Section titled “POST /api/connections/:id/test”Makes one cheap, read-only call through the connection, by the same path stages use, so token refresh, vault decryption and the needs_reauth handling are shared. No body. A failed test is a normal answer (HTTP 200, ok: false):
{ "ok": true, "checkedAt": "2026-11-24T12:04:31.120Z", "latencyMs": 212, "detail": "Acme workspace" }{ "ok": false, "checkedAt": "2026-11-24T12:09:02.480Z", "latencyMs": 148, "detail": "", "error": "Slack no longer accepts the saved credentials. Reconnect to restore access.", "action": "reconnect" }detail is short and human (a workspace or account name, 3 tools). error is a short message with the next action; action is reconnect (the credentials or permissions are the problem) or retry. Neither carries a token or the provider’s raw reply. When the call finds a revoked token, the connection becomes needs_reauth, as it would when a run found it. The result is stored and returned as lastTest on the connection.
| Status | Meaning |
|---|---|
| 401 | Not signed in. |
| 403 | A member may test their own connection, an admin any. Anything else: only an admin can test the workspace connection or you can only test your own connections. |
| 404 | Unknown connection id. |
| 409 | Connectors are off on this deployment (local mode, no vault key) or mocked (knetik dev); the message says why. |
| 429 | The connection was tested less than 5 seconds ago. Retry-After and the message say when to retry. |
GET /connectors/:provider/callback
Section titled “GET /connectors/:provider/callback”The provider sends the browser here. It redirects to /#connected=<label> or /#connect-error=<message>, which the dashboard reads on load.
PUT /api/connectors/:provider/app and DELETE /api/connectors/:provider/app
Section titled “PUT /api/connectors/:provider/app and DELETE /api/connectors/:provider/app”Admins only. Enter or clear a connector’s OAuth app credentials when the server’s environment does not provide them. Body: { "values": { "clientId": "...", "clientSecret": "..." } }. The fields come from GET /api/connectors (setup.fields). A secret sent back as its mask keeps the stored value. 409 when the environment provides the credentials; 403 for anyone but an admin.
Users and roles
Section titled “Users and roles”Admins only (403 for everyone else). Roles are admin, member and viewer.
GET /api/users
Section titled “GET /api/users”{ "users": [{ "id": "usr_a1", "email": "ada@example.com", "name": "Ada", "role": "member", "status": "active", "source": "panel", "locked": false, "createdAt": "...", "lastLoginAt": "...", "addedBy": "usr_boss" }], "roles": [{ "role": "viewer", "can": [{ "permission": "runs.view", "label": "See runs, artifacts and the activity feed" }] }], "environment": { "admins": ["boss@example.com"], "allowed": ["*@corp.test"] }}status is invited, active or disabled. source is environment or panel. locked marks an admin from KNETIK_ADMINS.
POST /api/users
Section titled “POST /api/users”{ "email": "ada@example.com", "role": "member" } (role defaults to member). 201 with the new user, 400 for a bad address or role, 409 if the person is already there.
PATCH /api/users/:id
Section titled “PATCH /api/users/:id”{ "role": "viewer" } and/or { "disabled": true }. Disabling ends the person’s sessions at once. 409 when changing yourself, an environment admin, or the last admin (when no admin is listed in the environment).
DELETE /api/users/:id
Section titled “DELETE /api/users/:id”Only for someone who has never signed in (409 otherwise: disable instead).
What a role may call
Section titled “What a role may call”POST /api/runs and POST /api/runs/:id/gate need member or admin; viewers get 403. PUT /api/modules/:id/config and the connector setup routes need admin. Connecting, testing and disconnecting an account need member or admin; the workspace connection needs admin.
Live updates
Section titled “Live updates”GET /api/stream
Section titled “GET /api/stream”Server-sent events. See Live updates.