control plane
CliqHub is the control plane for Cliq: the team registry, organizations and realms, the daemons connected to them, and the runs they execute. The cliq CLI, the console and the daemons all use this API.
The endpoint pages in this tab are generated from the CliqHub source: routes, request schemas, and who may call each route (the route policy table) by scripts/generate_hub_openapi.py.
Base URL
/v1; agent-to-agent endpoints start with /a2a. Endpoints under /internal are called only by the console backend and are not reachable from the internet.
Requests
Nearly every endpoint isPOST /v1/{resource}/{action} with a JSON body, even reads. The exceptions are the health check (GET /v1/health), the two live streams (GET /v1/runs/stream, GET /v1/reviews/stream_messages, server-sent events with arguments in the query string) and the public A2A agent card.
Replies
Success:realm_id or org_id has neither), or there is no such endpoint (route_not_found).
error is the message, code the reason, and details structured detail when there is some. A body that fails the endpoint’s schema is 422 invalid_params.
Switch on the code; messages are for people and may change. Each endpoint page lists its errors with an example of each, and Errors lists every code.
Authentication
Send a token in theAuthorization header: Authorization: Bearer <token>.
Mint, rotate and revoke tokens with the Auth endpoints, or
cliq login / cliq realm token.
What a token may do is decided per endpoint by its role in the organization or realm the request names: realm member (view), operator (operate) or admin, plus a permission such as teams.install for some actions. Each endpoint page says exactly what it needs. When you lack access to a record, CliqHub usually answers 404 not_found rather than 403, so it does not reveal that the record exists.
Endpoints
Endpoints are grouped by resource in the sidebar. What each resource is for:System
Service health, and re-running the seed of built-in data (site administrators).Auth
API tokens. Every call to CliqHub carries one asAuthorization: Bearer <token>:
- User token (
cliq_tok_…): acts as you, optionally limited bypermissions(which organizations and realms, and read / write / admin per kind of resource).cliq loginstores one; mint more for scripts and CI. - Realm token (
cliq_dt_…): what a daemon uses to join and work in a realm. Any member of the realm can mint one. - A2A token (
cliq_a2a_…): what outside agents send to a realm’s A2A endpoint. One per realm; minting a new one replaces the old. - Dispatch token: a short-lived signed token CliqHub uses when it sends work to a daemon; each realm has a dispatch key pair for it.
Users
User profiles. Which users you see depends on who you are: site administrators see everyone, organization admins see their members, everyone else sees themselves. Account administration (create, suspend, delete, passwords) is done by site administrators in the console.Organizations
An organization owns realms, teams (through its scopes) and people. Every organization has four built-in roles, Owner, Admin, Operator and Member, and can define its own: a role is a named set of permissions (List permissions shows them all). Owners can do everything;org.delete and org.transfer belong to owners only.
Scopes are the organization’s package namespaces (@acme, @acme-labs): teams are
published under a scope, and only the scope’s members may publish to it. The organization’s
team library lists the teams its realms may use. Organization-wide notification rules
also live here.
People join an organization through Send an invitation. Organizations are created by site
administrators for their future owner.
Invitations
Invitations bring people into an organization (as member, admin or owner) or a realm (as member, operator or admin). Sending one emails a link; the person previews it and accepts or declines with the token in the link. Someone without an account sets their username and password when accepting, and gets a session token back. An invitation ispending until it
is accepted, declined, revoked or expires (after 7 days); sending it again to the same
address renews it.
Teams
The CliqHub team registry. A team is published under a scope (@acme/code-review) as
numbered versions. Create a draft, change it (each change can mint the next version),
publish it to make it installable, then install it on daemons. List teams with a
realm_id to see a realm’s roster and where each team is installed, or with a
daemon_id to see what one daemon has. Build a team with AI drafts a team from a
description.
Changing a team (update, rename, publish, unpublish, delete) needs its author, or the
publish permission in the organization that owns its scope.
Realms
A realm groups daemons, the people who may use them, and the teams they should run. Its members have a role: member (can see), operator (can run and operate) or admin (can manage). Daemons join with a realm token, people with an invitation. A realm’s team list is the set of teams its daemons should have: Add a team to a realm installs it on the realm’s online daemons, and daemons that join later get it too. A realm can also have its own notification rules, and A2A access so outside agents can send it tasks. Several of these endpoints answer{ ok: true, realm }-style bodies rather than
{ ok: true, data }; each page shows its exact shape.
Daemons
Daemons (cliqd) connected to CliqHub. A daemon joins a realm with a realm token
(cliq_dt_…, from Generate a token with type: realm, or cliq login on the daemon). With
that token it registers, sends a heartbeat, reports its installed teams, refreshes the
realm’s access list and acknowledges each command CliqHub sends it. People list, inspect
and remove daemons.
A daemon is online while it sends heartbeats, then stale, then offline; removed
once deregistered or removed.
Workspaces
The workspaces (project folders) daemons have registered, as CliqHub last saw them, with the teams assigned to each. Workspaces are created and changed on the daemon (cliq init,
cliq assemble); CliqHub records them when a run starts and keeps a catalog. You see the
workspaces of daemons in your realms.
Runs
Runs of a team on a daemon. People start runs (Start a run), follow them (Get a run, Stream run activity, Search run logs, Get run telemetry), and control them (Cancel a run, Resume a run, Supply run inputs). CliqHub hands each control to the run’s daemon, which must be online: when it is not, the call fails with arun/daemon_offline or run/daemon_stranded
conflict (cancel instead marks the run cancelled on CliqHub).
Daemons report what happens during a run through the other endpoints here, with their realm
token: Record a new run, Update run status, Complete a run, and three separate channels for
run activity (the live timeline), run telemetry (token usage and traces) and run logs (text).
Artifacts
Files a run produced (reports, patches, screenshots), stored by CliqHub, and the run’s records (phase outputs, transcripts). Daemons upload files while the run is going; anyone who can see the run lists and downloads them. Download links are presigned and expire after 5 minutes; ask again for a fresh one.Events
The notification event bus. Events have a type from CliqHub’s catalog (run.failed,
phase.input_required, hug.review_requested, daemon.offline, …) or a custom type
custom.<name> registered for a realm. Notification rules match events and deliver them to
channels. Daemons and integrations submit events; CliqHub raises some itself. This is not
the live run timeline (that is Runs).
Reviews
Human-in-the-loop (HUG) reviews. When a team reaches a review phase, the agent opens a review; CliqHub notifies the reviewers (people and channels named in the team or at run start) and shows the review in their inbox. A reviewer reads it, can chat with the agent, and gives a verdict (PASS, REJECT or ROUTE:<phase>); with an all policy every group
must answer first. The agent then picks up the decision and acknowledges it.
A review is pending, then decided, then completed once the agent acknowledged it, or
expired when nobody answered in time (4 hours by default).
Notification channels
Where notifications go. A channel has one or more destinations (Slack, email, a webhook, the CliqHub inbox, or another channel by name) and belongs to an organization or a realm; names are unique within that scope. Notification rules (on Organizations and Realms) decide which events reach which channel. Built-in channels cannot be changed or removed.Notifications
Your in-app inbox in CliqHub, the notifications delivered to you through the CliqHub inbox destination of a channel.Agents
The agent catalog: built-in agents that ship with cliq (is_system: true, in every
organization) and custom agents your organization registers (cliq agent register). An
agent is identified by organization, name and version; only its manifest is stored here,
the code runs on daemons. Agent settings (API keys, models, …) can be set for the
organization and overridden per realm; secret values come back masked unless you hold
agents.reveal.
Settings
Deployment-wide settings that every daemon picks up (docker.base_image,
hub.registry_url, …) with cliq settings pull. Only site administrators change them; a
daemon’s realm token can read them, plus settings set for daemons of its realm.
Mesh
The agent mesh: a provider that lets your realms’ agents be found and called by other agents (A2A). An organization picks a provider and its settings; realms inherit it unless they override it (Realms, Manage A2A for a realm). Organization admins manage these.Jira
The Jira (Forge) app’s connection to CliqHub: it binds a Jira workspace to a realm so Jira can start runs and receive results. Called by the Jira app with a session or itsapi_token
(a CliqHub user token). These endpoints answer 404 when the integration is turned off.
A2A
Agent-to-agent (A2A) access to a realm. Outside agents read the realm’s agent card to see its skills (one per team the realm runs), then send tasks with JSON-RPC tosend, using the
realm’s A2A token. A2A must be turned on for the realm (Realms, Manage A2A for a realm).