Skip to main content
Version: v1

Excubio Watch API

API of excubio-watch (docs/watch.md). The API conventions are those of the hub API (docs/api/hub.yaml), and x-excubio-role uses the roles and scopes of the cloud API conventions (docs/api/cloud.yaml), with check-token for a check's token and cloud for the cloud's client certificate.

  • Beats. Heartbeat and reverse-check URLs carry their check token in the path; senders that can set headers send it as a bearer header instead, with - in place of the token in the path. It is the only credential and authorises nothing but the beat or the check. Paths with tokens are redacted in logs.
  • Management API (/api/v1). The cloud UI's Watch page and excubioctl call Watch directly, never through the cloud. They authenticate with the access token of a Zitadel login of the tenant's organization, the same organization as for the cloud (docs/watch.md §3), issued for Watch's own OIDC client; Watch verifies it with the organization's signing keys and finds the tenant by the organization; of several tenants that share one (docs/architecture.md §12), the one whose slug the request names in the header Excubio-Tenant, which the cloud UI always sends, else the only one where the login holds a role. Watch keeps no session; it answers CORS, preflight included, for the check operations (/api/v1/checks and below) to the exact origin of a tenant's cloud UI (https://<slug>. and the host of the cloud's public URL, EXCUBIO_CLOUD_PUBLIC_URL), for tenants it holds, without credentials, and to no other origin. Scripts use API tokens (exk_…) that Watch issues. Since Watch never calls the cloud, it learns who holds the tenant roles auditor and tenant-admin (docs/architecture.md §10) from the cloud with the tenant (PUT /internal/v1/tenants/{tenant}): auditors read, tenant admins also write.
  • The cloud's pushes (/internal/v1, tag replica). The cloud is the only writer of tenants, their roles and numbers, their hubs and the rotation replica, and it repeats every push with each replica push, every 5 minutes, so that a call Watch missed is made up by the next (docs/watch.md §5). Each is a full statement and idempotent.
  • Tenant states (docs/architecture.md §12): the management API of a suspended tenant reads only (403 tenant.suspended for writes) while its checks are evaluated and page as before; a deleting tenant is deleted with the push that says so.
  • Errors. Problem codes are listed with their meaning in the Problem schema (x-enumDescriptions). Every management operation can answer 401 (auth.unauthenticated), 403 (auth.forbidden), 404 (object.not_found), 422 (request.invalid) and 429 (request.rate_limited); every write also 409 (idempotency.in_progress) and 422 (idempotency.mismatch). Operations list the other codes they answer with.

Authentication​

API token of the tenant (exk_…), issued by Watch

Security Scheme Type:

http

HTTP Authorization Scheme:

bearer