Plain HTTP routes
The hub routes that are not tRPC: health, sessions and cookies, OAuth, uploads, log export and the addon gateway, with the credential each accepts.
Besides /trpc, the hub answers a few plain HTTP routes. This table is maintained by hand in
scripts/http-routes.mjs; npm run gen:api warns about any literal route in the server code that the
table does not list.
"Login session" means the token auth.login returns (or the camstack_session cookie that carries it);
a minted token is refused where the table says so.
| Route | Credential | What it is for |
|---|---|---|
GET /health | None | Liveness: {"ok":true}, or 503 while the hub is not ready. Nothing else, so it is safe to expose to a monitor. |
GET /health/details | Login session (Bearer or cookie); a minted token is refused | The hub health report: version, uptime, process and agent details. |
GET /health/agents | Login session (Bearer or cookie); a minted token is refused | The ids of the agents online now. |
GET /health/agents/:nodeId | Login session (Bearer or cookie); a minted token is refused | One agent’s health report, fetched through the hub. |
GET /health/cluster | Login session (Bearer or cookie); a minted token is refused | The hub and every online agent in one answer. |
GET /adaptive-probe | Login session (Bearer or cookie); a minted token is refused | A connection-quality probe the apps use to pick a stream quality. |
GET /api/release-identity | None | The product and server versions shown on the sign-in page. |
GET /api/auth/whoami | Any token or login session, Bearer header only | Who the credential is: user, admin or not, scopes, credential id. 401 when the token is revoked or expired. |
POST /api/auth/session | A login session token in the JSON body ({"token": "…"}) | Turns a login session into the camstack_session cookie, for browser pages and media URLs. |
DELETE /api/auth/session | None | Clears the camstack_session cookie. |
GET /api/embed-auth | Login session, Bearer header only (a minted token or share link is refused) | Sets the session cookie, then redirects (?next=) to an embedded player page; for app web views. |
GET, POST /api/oauth2/authorize | The camstack_session cookie of the person consenting | The consent step of an account-link (OAuth 2) flow, e.g. linking Alexa. |
POST /api/oauth2/token | No header: the authorization code of the flow (with its PKCE verifier when required) or a refresh token, form- or JSON-encoded | The token endpoint of an account-link flow, called by the linked service. |
GET /api/oauth2/integrations | None | The services that can be linked through OAuth 2. |
POST /api/addons/upload | Administrator: an admin session or a * token | Uploads an addon package (multipart, at most 50 MB) to install it. |
POST /api/server-upload | Administrator: an admin session or a * token | Uploads a server package to stage an update. |
GET /api/logs/export | Administrator login session, Bearer header (a minted token is refused) | Downloads the hub logs as a file. |
GET /api/backup/download/:locationId/:archiveId | Administrator login session, Bearer header (a minted token is refused) | Streams one backup archive. |
ALL /addon/:addonId/* | Per route — see "The addon gateway" below | Routes served by addons: snapshots, streams and player pages, webhooks, sign-in callbacks. |
The addon gateway
Every addon can serve its own routes under /addon/<addonId>/… — snapshot and stream endpoints, webhooks,
sign-in callbacks. Each route declares its access: public, authenticated or admin. For anything but
public the hub reads Authorization: Bearer <token>, else the camstack_session cookie; with neither, a
browser page is sent to the sign-in page and any other request gets 401. Then:
- an
adminroute needs an administrator (a*token or an admin session); - an
authenticatedroute admits a person’s login session, or a token holding anaddongrant on that addon for the request’s access (GET/HEAD→view,POST/PUT/PATCH→create, otherwisedelete); - a share link is admitted only by a stream or media endpoint that accepts its kind, and only for its devices.
A refused request gets 401 {"error":"Invalid token"} or 403 with Admin required, Token scope mismatch
or Share token not accepted here.