REST API
Everything the console does goes through a REST API. Where its reference lives, how requests are authorized and how to pick a workspace.
On this page
The console is built on the same REST API you can use. Every route, parameter and response is listed in the interactive API reference, generated from the code, so it is always current.
Base URL
All routes live under:
https://www.zenhalab.com/api/nomongeta/v1The machine-readable OpenAPI 3.1 document is at https://www.zenhalab.com/api/nomongeta/openapi.json. Import it into Postman, Insomnia or a code generator.
Authorization
Requests run as a signed-in person, with the session your browser gets when you sign in, and can do exactly what that person can do in the console.
Choosing a workspace
Every route acts in one workspace:
- the workspace in the
x-workspace-idheader, when you send one; - otherwise the workspace you last chose in the console;
- otherwise your personal workspace.
GET /api/nomongeta/v1/workspaces lists the workspaces you can open, with their ids. A workspace you can't open, and any id that belongs to another workspace, answers 404.
const res = await fetch("/api/nomongeta/v1/agents", {
headers: { "x-workspace-id": "<workspace id>" },
});
const agents = await res.json();Roles
Each route needs a minimum role in the workspace. The reference shows it on every route as x-required-role.
| Role | In the API | Can |
|---|---|---|
| Viewer | viewer | Sees the agents and their numbers. Read-only. |
| Agent | agent | Reads conversations and answers handoffs. Can't change agents. |
| Builder | builder | Builds agents, skills and knowledge, and tests them in the playground. |
| Admin | admin | Members and channels, plus everything a builder does. |
| Owner | owner | Everything, including members, billing and the workspace itself. |
Errors worth knowing
| Status | Meaning |
|---|---|
402 billing_hold | The workspace's subscription is unpaid past its grace period. Only billing routes answer. |
403 workspace_suspended | The workspace, or the agency it belongs to, is suspended. |
404 | Not found, or not in this workspace. |
422 | Publishing a flow that still has errors. |
429 | Too many writes from your address (rate_limited: wait the seconds in Retry-After), or a plan limit reached (agent_limit, flow_limit, connection_limit …). |
503 | The platform is in maintenance: reads work, writes wait. |
Limits
Writes (POST, PUT, PATCH, DELETE) are limited to 240 a minute from one IP address; reads aren't limited. Your plan's limits apply as they do in the console: creating more agents, flows or channels than it allows answers 429 with the limit reached. See plans and limits.
What's only in the API
- The vault of secrets your flows sign in with.
- Contacts: listing, searching and erasing them.
See also calling your systems from a flow and the widget reference.
Still stuck?
Ask us. We read every message.