Credentials
Use the smallest credential that fits the job. Privilege lives on the token grant, not on an /admin URL.
Hub Core accepts exactly two Bearer forms on /v1: user PAT (cliq_tok_…) and realm token (cliq_dt_…). There is no Hub session JWT and no cliq_dk_… prefix.
Cheat sheet
All Hub
/v1 data-plane calls use:
user | realm.
API planes
There is no
/admin route tree. The same resource paths serve everyone; the grant decides if the call is allowed.
Interactive specs on this site: Hub API and Daemon API only.
Grants (domains + access)
Every user and realm token carries a grant underpermissions:
- Domains — where the credential may act (each key is optional):
orgs— list of org ids (integers), or*realms— list of realm ids, or*
- Access — per entity, one or more of
read|write|admin:read— get / list (including run details and logs)write— create / update / publish / dispatch / cancel / heartbeatadmin— irreversible tenancy ops (delete user/org, rotate org keys, …)
@acme/…) are not a token domain. Which namespaces you can publish or install into comes from scope membership on the scopes resource (owned / org / member). Tokens only use access.scopes to manage that catalog.
Allowed access entity keys:
Team publish/list for a namespace requires scope membership plus
access.teams (usually write).
Dispatch is a write (usually runs write or dispatch write). Run events, logs, phases, and artifacts share the runs entity — they are not separate domains.
Package namespaces live on the Scopes resource (membership + catalog CRUD) — not under Auth token mint.
Mint templates
CI publisher — put the machine user in theacme scope (scopes resource); grant team write via permissions:
Session (people)
Interactive login goes through the BFF session resource — not Core/v1/auth/login.
The browser never holds Hub PATs. The BFF stores
user_token and target_token server-side and always calls Core with Authorization: Bearer <target_token>. Act-as is a session update, not a Core RPC.
cliq login hands the credentials to cliqd, which calls POST /v1/session/create and keeps the returned session-scoped PAT (cliq_tok_…) in its store as hub.session. The CLI stores nothing. Do not use that value as cliq.api_key. There is no JWT refresh path — cliq logout revokes the session PAT; cliqd keeps its daemon token and realm.
Accounts are not created via a public signup API. Provisioning goes through CliqHub BFF → private Hub /internal routes. Day-to-day login stays on the BFF session API.
User token (automation)
cliq.api_key logs cliqd in with that standing user PAT (no password needed — handy for CI and containers). Only durable user PATs (cliq_tok_…) are accepted; a session-scoped login PAT is refused.
Use that Bearer on Hub API the same way you’d use a session PAT, limited by the grant. Rotate or revoke from the console (Account → Tokens) or Hub API:
Create response (
POST /v1/auth/generate_token):
token is returned once. realm_ids is non-empty for realm enroll tokens.
Realm membership roles
People join a realm through an invitation in CliqHub. A realm admin sets each member’s role (CliqHub realm page, orPOST /v1/realms/add_member). The role is that user’s access inside the realm — not a bulk add of everyone with a title. There is no cliq realm command.
The realm’s creator is
admin.
Realm token (machines)
Mint on the realm page in Hub, or as any realm member (cliq login does this automatically when it enrolls a daemon):
realm_id, dispatch_public_key, acl); cliqd holds the dispatch key in memory and refreshes it on heartbeat. Rotate it with cliq auth rotate-dispatch --realm <realm_id> when needed.
A daemon only syncs runs of teams on the realm’s team list. Runs of other teams wait on the machine until a realm admin adds the team — see How teams get installed.