Skip to main content
Version: v1

Excubio cloud API

API of excubio-cloud: people, devices, teams, rotations, incidents, hubs, the hub link, the installation channel and carrier callbacks. The API conventions are those of the hub API (docs/api/hub.yaml), with the additions below. The mobile app uses this API with a device token (exd_…, docs/mobile.md §2); there is no separate app API. The cloud UI's Watch page calls the Watch API (docs/api/watch.yaml) directly.

The tenant comes from the host name (<slug>.excubio.example) for the management API, from the client certificate for the hub link (the installation channel serves the vendor's installations, not a tenant), and from the called number for inbound SMS (sender numbers are dedicated to one tenant, docs/on-call.md §4) and the carrier reference for receipts and call events. Inbound SMS and call events carry the carrier's event ID; a repeat of one is answered as the first was and changes nothing.

Cloud API conventions:

  • Sessions. The cloud UI signs in with OIDC through the tenant's Zitadel organization (startOidcLogin on the tenant's host, completeOidcLogin at the installation's one callback, redeemLoginHandoff back on the tenant's host): the cookie ex_session (HttpOnly, Secure, SameSite=Strict, for the tenant's host only) and a CSRF token that every request with the cookie other than GET carries in X-CSRF-Token (403 auth.csrf without it). Lifetimes: docs/architecture.md §11. Roles are read from the tenant's rows on every request, so a role or a team membership that a tenant or team admin removes is gone with the next request, whatever the credential.
  • Vendor operators call the platform operations, on any tenant host or the installation's own, with an access token of the vendor's Zitadel organization (operatorLogin); there is no operator session. On a tenant's host the same token, while the tenant has an active support grant for the operator (docs/architecture.md §10), may call every GET operation that lists the role auditor, and nothing else; each such request is audited with actor kind vendor.
  • The billing service (the vendor's service of customer accounts, payment and plans) calls the operations of tag billing, on the installation's own host, with an access token of its machine user at the installation's Zitadel (billingLogin): a JWT for the audience EXCUBIO_BILLING_AUDIENCE whose subject is EXCUBIO_BILLING_SUBJECT (docs/operations.md §3). That token reaches these operations and nothing else, and no other credential reaches them (docs/architecture.md §10). Each call is audited in the installation's audit (platform_audit) and a call that changes a tenant in the tenant's audit too, with actor kind service.
  • Tenant states. What a suspended or deleting tenant's credentials may do: docs/architecture.md §12. In a suspended tenant every operation works except the writes that only the role rotation-manager, team-admin or tenant-admin allows the caller, which answer 403 (tenant.suspended); a deleting tenant answers every request 401 (tenant.deleting).
  • Roles. x-excubio-role on each operation names the least role that allows it and where the role must be held; a list names alternatives. Roles are the cloud roles of docs/architecture.md §10 (member, rotation-manager, team-admin, auditor, tenant-admin) and these:
    • may-respond: the caller may respond to the incident (docs/on-call.md §5); merge needs it for both incidents.
    • informed: the caller is one of the people of an involved rotation informed of the incident (docs/on-call.md §3); it allows reading the incident and the action join.
    • hub: the hub's client certificate; enrolment: the enrolment token; installation: the client certificate of an installation of the vendor, for the hubs placed on it (docs/operations.md §4); installation-enrolment: an installation's enrolment token; idp-login: the person's IdP access token on the device; cli-login: the access token of the person's excubioctl login; calendar-token: the secret of a calendar feed; incident-link: the token of a signed incident link, for its one incident and person, and only the actions ack, decline, snooze, escalate and note (docs/on-call.md §5); carrier: a carrier's signature; platform-operator: a vendor operator (platform_operator); billing-service: the billing service's machine user.
  • Scopes of a role: self (the caller's own objects: their person, contacts, devices, absences, overrides, swaps, punches, tokens), team (a role in the team named by the path or body), rotation (a role in the team of the rotation the object belongs to; for may-respond, the incident), tenant (a tenant role, or for member a membership of any team), installation (all tenants), public (no person: the operation's security scheme alone authorises it). tenant-admin satisfies every other role in every team and the tenant, except may-respond, which no other role implies.
  • Visibility. Lists and reads return what the caller may see. An incident is visible to those who may respond to it, to people of an involved rotation informed of it, to auditors and to tenant admins.
  • Device tokens act as their person with the rights of member: they may call operations whose role is member or may-respond, except those marked device: false. An app version older than 12 months gets 426 (app.update_required).
  • API tokens. A person's token acts with the person's roles. A service-account token belongs to the tenant, is created by a tenant admin and has no roles of its own: it acts only through its scopes. A token with scopes can call only the operations whose token-scope is one of them, within the teams the scope names: pages (manual pages), incidents (read and respond to incidents: a service-account token with it may respond, as may-respond allows, to the incidents of the rotations of those teams), oncall (read rotations, shifts and who is on call), config (a service-account token's: the tenant's configuration of teams, members, rotations and hubs, as docs/architecture.md §10 lists it); pages:<team> limits a scope to one team, a scope without a team covers every team. A list in token-scope names alternatives. token-scope: none: no token with scopes can call it.
  • Errors. Problem codes are listed with their meaning in the Problem schema (x-enumDescriptions). Every operation can answer 401 (auth.unauthenticated, device.expired, device.revoked, tenant.deleting), 403 (auth.forbidden, auth.csrf, tenant.suspended), 404 (object.not_found), 422 (request.invalid), 429 (request.rate_limited), 503 (service.unavailable: retry) and 500 (service.error: a fault of the cloud that a retry doesn't mend; its request_id finds it in the cloud's log); every write also 422 (idempotency.mismatch) and, but on the hub link, 409 (idempotency.in_progress). Every response carries its request's id as X-Request-Id. Operations list the other codes they answer with.
  • Idempotency. A repeated Idempotency-Key returns the first response for 24 h, for a hub's link calls for 7 days (docs/architecture.md §5). A repeat that arrives while the first request still runs is answered 409 (idempotency.in_progress), as by the hub API; on the hub link it waits for the first and returns its response instead, since a link call's 409 means link.resync. A stored response that carries a token shown once is sealed (docs/schema/cloud.sql idempotency_key).
  • Live updates. The UIs and the app follow GET /api/v1/stream and re-fetch what changed.

Authentication​

API token (exk_…)

Security Scheme Type:

http

HTTP Authorization Scheme:

bearer