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:

text
https://www.zenhalab.com/api/nomongeta/v1

The 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:

  1. the workspace in the x-workspace-id header, when you send one;
  2. otherwise the workspace you last chose in the console;
  3. 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.

js
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.

RoleIn the APICan
ViewerviewerSees the agents and their numbers. Read-only.
AgentagentReads conversations and answers handoffs. Can't change agents.
BuilderbuilderBuilds agents, skills and knowledge, and tests them in the playground.
AdminadminMembers and channels, plus everything a builder does.
OwnerownerEverything, including members, billing and the workspace itself.

Errors worth knowing

StatusMeaning
402 billing_holdThe workspace's subscription is unpaid past its grace period. Only billing routes answer.
403 workspace_suspendedThe workspace, or the agency it belongs to, is suspended.
404Not found, or not in this workspace.
422Publishing a flow that still has errors.
429Too many writes from your address (rate_limited: wait the seconds in Retry-After), or a plan limit reached (agent_limit, flow_limit, connection_limit …).
503The 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

See also calling your systems from a flow and the widget reference.

Still stuck?

Ask us. We read every message.

Privacy