Skip to main content
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 (401 auth.unauthenticated, intake intake.invalid_token). A host of no hub is answered 404 hub.unknown_host on every path but healthz, readyz and completeOidcLogin (intake: 401 intake.invalid_token), the same for every such host; the problem carries the installation's hub_domain.
  • A suspended hub (docs/architecture.md §12 Tenant states) answers every write 403 hub.suspended but 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 cookie ex_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 than GET carries in the header X-CSRF-Token; getMe returns it again. How long a session lasts: docs/architecture.md §11.
  • Every operation carries x-excubio-role: role is the role that may call it, as may every role that includes it (the roles and what each includes: docs/architecture.md §10), scope where a binding must hold, and token-scope the token scope that also grants it. The cloud and Watch APIs list their values in their own descriptions. In this API, role is a hub role, or intake (an intake token of the path's Source), any (any signed-in user or API token, no binding needed) or none; scope is team (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) or public (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.
  • GET never issues a credential and changes no state, except Watch's beat and reverse-check calls (docs/watch.md §1); tokens and codes are created by POST. A 204 to a DELETE means 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 gets 409 (idempotency.in_progress).
  • Lists use cursor pagination (cursor, limit ≤ 500) and return items and next_cursor (null on the last page).
  • A list that takes sort orders 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 (its id, unless the operation names another); without sort, by the operation's default. An unknown or repeated field is 422 (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 is 422 (request.invalid).
  • A list that takes total counts with total=true the items that match its filters, on every page: total, counted up to 10 000, and total_capped, true when more match (total is then 10 000). The count reads at most 10 001 matching rows; without total=true the response has neither field. An operation that takes sort or total lists 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 202 with an Operation; poll GET /api/v1/operations/{id} or follow the operation event of GET /api/v1/stream.
  • Errors are RFC 9457 problem details with a stable code (the catalogue is Problem.code) and the request_id that the logs and the audit carry. Each operation lists the codes particular to it; any operation can also answer 401 (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) and 503 (service.unavailable).
  • 429 and 503 carry Retry-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​

API token (exk_…)

Security Scheme Type:

http

HTTP Authorization Scheme:

bearer