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 (
startOidcLoginon the tenant's host,completeOidcLoginat the installation's one callback,redeemLoginHandoffback on the tenant's host): the cookieex_session(HttpOnly,Secure,SameSite=Strict, for the tenant's host only) and a CSRF token that every request with the cookie other thanGETcarries inX-CSRF-Token(403auth.csrfwithout 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 everyGEToperation that lists the roleauditor, and nothing else; each such request is audited with actor kindvendor. - 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 audienceEXCUBIO_BILLING_AUDIENCEwhose subject isEXCUBIO_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 kindservice. - 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-adminortenant-adminallows the caller, which answer403(tenant.suspended); a deleting tenant answers every request401(tenant.deleting). - Roles.
x-excubio-roleon 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);mergeneeds 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 actionjoin.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'sexcubioctllogin;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 actionsack,decline,snooze,escalateandnote(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; formay-respond, the incident),tenant(a tenant role, or formembera membership of any team),installation(all tenants),public(no person: the operation's security scheme alone authorises it).tenant-adminsatisfies every other role in every team and the tenant, exceptmay-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 ismemberormay-respond, except those markeddevice: false. An app version older than 12 months gets426(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-scopeis 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, asmay-respondallows, 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 intoken-scopenames 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 answer401(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) and500(service.error: a fault of the cloud that a retry doesn't mend; itsrequest_idfinds it in the cloud's log); every write also422(idempotency.mismatch) and, but on the hub link,409(idempotency.in_progress). Every response carries its request's id asX-Request-Id. Operations list the other codes they answer with. - Idempotency. A repeated
Idempotency-Keyreturns 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 answered409(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's409meanslink.resync. A stored response that carries a token shown once is sealed (docs/schema/cloud.sqlidempotency_key). - Live updates. The UIs and the app follow
GET /api/v1/streamand re-fetch what changed.
Authentication
- HTTP: Bearer Auth
- API Key: session
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- Hub Certificate
- Installation Certificate
- HTTP: Bearer Auth
- HTTP: Bearer Auth
- API Key: carrierSignature
API token (exk_…)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Security Scheme Type: | apiKey |
|---|---|
Cookie parameter name: | ex_session |
Enrolment token (exe_…)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Device token of the app (exd_…), docs/mobile.md §2
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Token of a signed incident link (exl_…) from an SMS: the web page at /l/<token> sends it as a bearer header; it reads that one incident and gives the responses docs/on-call.md §5 allows a link, as its person, until the incident resolves and at most 24 h (docs/architecture.md §11)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Access token of the person's IdP login on the device, issued by the tenant's Zitadel organization as a JWT for the app's client (docs/architecture.md §12)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Access token of a person's excubioctl login at the tenant's Zitadel organization, a JWT for excubioctl's client (EXCUBIO_CLI_OIDC_CLIENT_ID, docs/architecture.md §12); createCliToken takes it and no other operation
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Access token of a vendor operator's login at the vendor's own Zitadel organization (docs/schema/cloud.sql platform_operator), a JWT for the operators' client (docs/architecture.md §12)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
The hub's client certificate
The client certificate of an installation of hubs that the vendor runs (common name installation: followed by the installation's id); it authenticates on the installation channel only
An installation's enrolment token (exm_…)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Access token of the billing service's machine user at the installation's Zitadel, a JWT for the audience EXCUBIO_BILLING_AUDIENCE with the subject EXCUBIO_BILLING_SUBJECT (docs/architecture.md §10)
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Verified per carrier with the carrier's scheme
Security Scheme Type: | apiKey |
|---|---|
Header parameter name: | X-Carrier-Signature |