Version: v1
Excubio hub API
Intake and management API of excubio-hub.
Conventions (shared by the hub, cloud and Watch APIs):
- JSON bodies; timestamps RFC 3339 in UTC; ids UUIDv7; durations as
strings with a unit (
5m). - Versioned paths (
/api/v1). A breaking change needs a new version; the old one is kept for 12 months. - Authentication: session cookie with CSRF header (UI), or bearer API
token (
exk_…); in the cloud API also the app's device token (exd_…). Intake uses intake tokens (exi_…), only on the intake paths (on the intake listener, and on a managed installation also the management listener, docs/operations.md §2), and an intake path takes nothing else. Credentials are never accepted in query strings. - Hosts: a hub's management API, UI and HTTPS intake answer on its
host name,
<host label>.<hub domain>on an installation of several hubs; an installation of one answers on any name (docs/architecture.md §11 Front door). Every credential is checked under the hub of the request's host only, so one of another hub is refused as a wrong one is (401auth.unauthenticated, intakeintake.invalid_token). A host of no hub is answered404hub.unknown_hoston every path buthealthz,readyzandcompleteOidcLogin(intake:401intake.invalid_token), the same for every such host; the problem carries the installation'shub_domain. - A suspended hub (docs/architecture.md §12 Tenant states) answers
every write
403hub.suspendedbut signing in and out, responding (/alerts,/groups,/pages,/downtimes,/heartbeats,/tickets,/operations), the previews,explain, exports and the audit's verification; intake goes on. - Sessions: the hub UI signs in with OIDC (
startOidcLogin,completeOidcLogin,redeemLoginHandoff) or as the local break-glass admin (localLogin). Each sets the cookieex_session(HttpOnly,Secure,SameSite=Strict, for the hub's host only) and returns the session's CSRF token, which every request with the cookie other thanGETcarries in the headerX-CSRF-Token;getMereturns it again. How long a session lasts: docs/architecture.md §11. - Every operation carries
x-excubio-role:roleis the role that may call it, as may every role that includes it (the roles and what each includes: docs/architecture.md §10),scopewhere a binding must hold, andtoken-scopethe token scope that also grants it. The cloud and Watch APIs list their values in their own descriptions. In this API,roleis a hub role, orintake(an intake token of the path's Source),any(any signed-in user or API token, no binding needed) ornone;scopeisteam(a binding for the team of each object concerned, or a hub-wide one; lists and reports return only what is in the caller's scopes),hub(a hub-wide binding) orpublic(no credential);token-scope, where present, names the token scope (tickets,metrics) that also grants the call. A token with scopes calls only operations that name one of them. GETnever issues a credential and changes no state, except Watch's beat and reverse-check calls (docs/watch.md §1); tokens and codes are created byPOST. A204to aDELETEmeans the object is gone.- Every write accepts
Idempotency-Key; a repeated key within 24 h returns the first response. Keys are per caller (user, token, device, hub). The same key with another request is rejected (422,idempotency.mismatch); a repeat while the first request still runs gets409(idempotency.in_progress). - Lists use cursor pagination (
cursor,limit≤ 500) and returnitemsandnext_cursor(null on the last page). - A list that takes
sortorders by it: comma-separated fields of the operation, each<field>ascending or-<field>descending (-severity,title), nulls last in both directions, ties by the item's key ascending (itsid, unless the operation names another); withoutsort, by the operation's default. An unknown or repeated field is422(request.invalid) whose detail names the fields the list sorts by. Its cursor is opaque and holds the sort, the last item's sort values and its key: the next page starts after that item in that order, whatever was added, changed or removed in between (an item whose sort value changed in between may be passed over or come again); a cursor of another sort is422(request.invalid). - A list that takes
totalcounts withtotal=truethe items that match its filters, on every page:total, counted up to 10 000, andtotal_capped, true when more match (totalis then 10 000). The count reads at most 10 001 matching rows; withouttotal=truethe response has neither field. An operation that takessortortotallists it among its parameters; the cloud's lists follow the same rules (docs/api/cloud.yaml). - Selectors in query parameters use the short form (docs/spec-format.md §2).
- Long requests return
202with an Operation; pollGET /api/v1/operations/{id}or follow theoperationevent ofGET /api/v1/stream. - Errors are RFC 9457 problem details with a stable
code(the catalogue isProblem.code) and therequest_idthat the logs and the audit carry. Each operation lists the codes particular to it; any operation can also answer401(auth.unauthenticated),403(auth.forbidden,auth.csrf,auth.token_scope),400(request.malformed),422(request.invalid,idempotency.mismatch),409(idempotency.in_progress),429(request.rate_limited) and503(service.unavailable). 429and503carryRetry-After. On a managed installation a node bounds the requests of one hub it serves at once and the event streams of one hub it keeps open (docs/architecture.md §12 Requests per hub); beyond,429(request.rate_limited).
Authentication
- HTTP: Bearer Auth
- API Key: session
- HTTP: Bearer Auth
- HTTP: Basic Auth
API token (exk_…)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Session cookie; requests other than GET also carry X-CSRF-Token
Security Scheme Type: | apiKey |
|---|---|
Cookie parameter name: | ex_session |
Intake token (exi_…) of the Source
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Source name and intake token
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | basic |