REST API

The surface the dashboard itself runs on. Two credentials, deliberately kept apart: a session cookie says who you are, an org token says which workspace a request may touch.

Authentication

Signing in sets an HttpOnly session cookie. That cookie is not sufficient to read workspace data — you exchange it for a workspace-scoped bearer token, and the exchange is where membership is checked.

bash
# 1. sign in — sets the session cookie
curl -c jar.txt -X POST https://api.zealoop.com/api/auth/login \
  -H 'content-type: application/json' \
  -d '{"email":"you@company.com","password":"…"}'

# 2. see which workspaces this account can open
curl -b jar.txt https://api.zealoop.com/api/auth/me

# 3. trade the session for a workspace token
curl -b jar.txt -X POST https://api.zealoop.com/api/auth/token \
  -H 'content-type: application/json' \
  -d '{"orgId":"org_…"}'

# 4. use it
curl -H "Authorization: Bearer <token>" \
  https://api.zealoop.com/api/org/org_…/settings

Responses

Every response is JSON with a success boolean. Successful reads carry data, and lists add total. Failures carry error with a message written for a human.

json
{ "success": true,  "data": { … }, "total": 353 }
{ "success": false, "error": "You don't have access to that workspace" }

Session

Method & pathPurposeAuth
GET /api/auth/configWhich sign-in methods this server offersnone
POST /api/auth/signupCreate an account, sets the session cookienone
POST /api/auth/loginSign in, sets the session cookienone
POST /api/auth/logoutClear the session cookienone
GET /api/auth/meThe signed-in account and its workspacescookie
PATCH /api/auth/meUpdate the account display namecookie
POST /api/auth/tokenExchange the session for a workspace tokencookie
GET /api/auth/orgsWorkspaces this account holds a seat incookie
POST /api/auth/orgsCreate a workspace and its owner seatcookie
POST /api/auth/forgot-passwordBegin a password resetnone
POST /api/auth/reset-passwordComplete a reset and sign innone

Google and GitHub sign-in are a browser redirect, not a fetch: send the visitor to /auth/google or /auth/github, and the callback sets the session cookie and returns them to the dashboard.

Workspace

Method & pathPurposeAuth
GET /api/org/:orgId/settingsName, agent config, escalation, widget, planbearer
PATCH /api/org/:orgId/settingsUpdate any of the abovebearer
POST /api/org/:orgId/widget-secret/revealShow the widget secret oncebearer
POST /api/org/:orgId/widget-secret/rotateIssue a new widget secretbearer
GET /api/org/:orgId/onboardingGet Started checklist, derived from real databearer
GET /api/org/:orgId/meThe caller's seat in this workspacebearer
GET /api/org/:orgId/membersSeats in this workspacebearer
POST /api/org/:orgId/membersInvite a seatbearer
DELETE /api/org/:orgId/members/:memberIdRemove a seatbearer

Knowledge

Method & pathPurposeAuth
GET /api/knowledge/:orgId/sourcesList sources with status and chunk countsbearer
POST /api/knowledge/:orgId/sourcesAdd a URL, sitemap, file or snippetbearer
POST /api/knowledge/:orgId/sources/:sourceId/resyncRe-crawl and re-embedbearer
DELETE /api/knowledge/:orgId/sources/:sourceIdDelete a source and its chunksbearer
GET /api/knowledge/:orgId/chunksInspect chunks for one sourcebearer

Tables

Method & pathPurposeAuth
GET /api/org/:orgId/tablesList tables with row countsbearer
POST /api/org/:orgId/tablesCreate a table and its columnsbearer
PATCH /api/org/:orgId/tables/:tableIdRename or re-describebearer
DELETE /api/org/:orgId/tables/:tableIdDelete a table and its rowsbearer
GET /api/org/:orgId/tables/:tableId/rowsList or search rowsbearer
POST /api/org/:orgId/tables/:tableId/rowsAdd one rowbearer
PATCH /api/org/:orgId/tables/:tableId/rows/:rowIdEdit one rowbearer
DELETE /api/org/:orgId/tables/:tableId/rows/:rowIdDelete one rowbearer
POST /api/org/:orgId/tables/:tableId/importCSV upsert on the identity keybearer

Row writes return 409 when the identity value already exists — see Tables for why a duplicate is refused rather than resolved.

Actions

Method & pathPurposeAuth
GET /api/org/:orgId/actionsList actions with test statusbearer
POST /api/org/:orgId/actionsCreate an actionbearer
PATCH /api/org/:orgId/actions/:actionIdUpdate, enable or disablebearer
DELETE /api/org/:orgId/actions/:actionIdDelete an actionbearer
POST /api/org/:orgId/actions/:actionId/testRun a test call with sample argumentsbearer

Conversations & customers

Method & pathPurposeAuth
GET /api/org/:orgId/conversationsFilter by status, search, paginatebearer
GET /api/org/:orgId/conversations/:idMessages, traces and the customerbearer
POST /api/org/:orgId/conversations/:id/replyReply as a humanbearer
PATCH /api/org/:orgId/conversations/:idSet the conversation statusbearer
GET /api/org/:orgId/usersEnd users seen by the widgetbearer
GET /api/org/:orgId/users/:endUserIdOne customer with their historybearer

Analytics

Method & pathPurposeAuth
GET /api/analytics/:orgId/overviewResolution rate, cost, tokens, outcomes, daily seriesbearer
GET /api/analytics/:orgId/content-gapsClustered low-confidence queriesbearer

Widget

The public surface the browser widget talks to, under /api/widget. It authenticates with your workspace public key rather than a bearer token, and identity is established with the signed payload described in Identity & signing.

Errors

StatusWhen
400The request is missing a field or a value failed validation.
401No session, or no workspace token. Sign in, or mint a token.
403Signed in, but not a member of that workspace — or the token is for a different one.
404The workspace or resource does not exist.
409A uniqueness rule was violated — a duplicate identity value, or an already-invited seat.
500Logged with the failing request; the response never leaks internals.

Conventions