HTTP API overview
The dashboard is a client of a JSON HTTP API under /api. Everything the dashboard does, you can do with a request. The reference lists every endpoint, and Live updates describes the event stream.
| Path | Owner |
|---|---|
/api/* |
The JSON API. Always JSON, including for unknown paths ({"error":"not found"} with 404). |
/auth/*, /login |
Sign-in (hosted mode) |
/connectors/<provider>/callback |
OAuth return from a provider |
/.well-known/* |
Public metadata, such as /.well-known/oauth-client/knetik |
/assets/*, /fonts/*, /favicon.svg |
Dashboard static files |
| everything else | The dashboard, which handles /, /inbox, /runs, /modules, /connectors, /artifacts and /settings in the browser |
Authentication
Section titled “Authentication”- Hosted mode: every
/apicall exceptGET /api/healthneeds a signed-in browser session (a cookie). A missing session gets a 401. There are no API tokens yet, so non-browser callers such as CI cannot call the API on a hosted deployment. - Local mode and
knetik dev: no sign-in. The server only answers on this machine, socurl http://localhost:3000/api/...works.
State-changing requests (POST, PUT) must come from the server’s own origin: they need a matching Origin header, or Sec-Fetch-Site: same-origin. This stops another site driving a signed-in browser.
Reads are open to any signed-in user. A few writes are admin only: saving module configuration (PUT /api/modules/:id/config) and connecting a connector for the whole workspace. A member gets a 403 with a message.
Errors
Section titled “Errors”Errors are JSON with an error string and the matching status code.
{ "error": "unknown module \"nope\"" }Validation errors (400) can carry issues:
{ "error": "invalid input", "issues": [{ "path": "material", "message": "Invalid length: Expected >=2 but received 0" }] }| Status | Meaning |
|---|---|
| 400 | Invalid input, unknown filter value, malformed cursor |
| 401 | Sign in required |
| 403 | Not allowed, such as a member doing an admin action |
| 404 | Unknown module, run or artifact |
| 409 | Gate already decided with a different choice |
| 503 | Too many live streams; fall back to polling |
Pagination
Section titled “Pagination”List endpoints that can be long (/runs, /artifacts) return the newest first with a nextCursor. Pass it back as before to get the next page. Cursors are opaque; treat them as strings. nextCursor is null on the last page. /events pages by event id with before.
Caching
Section titled “Caching”Endpoints that must be fresh, such as module details, events and artifact lists, send cache-control: no-store.
A first call
Section titled “A first call”curl http://localhost:3000/api/health# {"ok":true,"modules":3}
curl http://localhost:3000/api/modules