OSOS as a Backend
Section titled “OSOS as a Backend”Everything the OSOS UI does is an HTTP call. The web application is one client of a gateway API on the order of 600 routes (about 450 of them are typed operations described by the services’ OpenAPI documents; the rest — packaging, files, sign-in and a few others — are documented by hand) — it has no private side channel, and nothing it can do is closed to other callers. That makes the platform usable headless: as the backend behind your own scripts, services and products, with its UI out of the picture entirely.
This cluster of guides is about building those other clients. This page sets the model, names the three shapes an integration takes, states what the server keeps enforcing no matter which client calls, and maps which existing guide owns which part of the story — so the rest of the cluster can stay task-focused and never restate the fundamentals.
The headless model
Section titled “The headless model”A headless client needs three things: a base URL, a credential, and the conventions in Calling the HTTP API. There is no required SDK.
All traffic goes to the gateway host, and the host itself names the tenant: a gateway plugin resolves the request’s Host header to a space id and forwards it as x-space-id. Your client never sends a tenant parameter — calling https://acme.example.com/api/… is selecting the tenant.
Credentials are validated at the edge, once. The gateway’s authentication plugins turn a bearer token or an API token into a set of identity headers that downstream services trust — which is why those services must never be exposed directly, a boundary The security boundary covers in full.
On the way back, every JSON response arrives in the same {success, result} envelope, with no version condition — except that a GET on /v3 is raw again Since 1.10 (details) — and every error in a single localized shape with a stable machine code. The contract — routing, URL versioning, envelope, error body, pagination, obtaining the OpenAPI documents — is owned by Calling the HTTP API and holds for everything in this cluster.
Three integration shapes
Section titled “Three integration shapes”Almost every integration is one of three shapes, and the shape decides your credential before you write any code:
| Shape | Typical example | Credential | Requests run as |
|---|---|---|---|
| First-party script or automation | A data loader, a nightly sync, a migration | API token (x-app-token) | The token’s application user |
| Headless service | Your own product using OSOS as its backend | An API token per environment, or a machine-to-machine OAuth client | A dedicated service identity |
| Third-party acting for a user | A BI tool, a portal surfacing platform data to its own users | Each user’s own OAuth bearer token | Each end user, individually |
A first-party script is the fastest path to a working call: get a token, send it as a header, done — the Quickstart takes exactly this route. The token carries no scopes of its own; it is bound to a dedicated application user, and its permissions are precisely that user’s roles and space membership. Least privilege therefore means constraining the user, not the token — Choosing a credential works through the consequences.
A headless service uses the same mechanics with more discipline: its own application user (or OAuth client) per environment, so staging can be revoked without touching production, and rotation can happen without downtime — covered in Token lifecycle and Environments and promotion.
A third-party acting for a user should hold no credential of its own. Each user authenticates through the platform’s OIDC provider, and the integration forwards that user’s token, so every request executes with exactly that user’s permissions. The flows live in Authentication & OAuth — and the platform ships a worked example.
A shipping example: the Grafana data source
Section titled “A shipping example: the Grafana data source”The Grafana data source is the third-party shape running in production, and two of its design choices are worth copying rather than re-deriving:
- It holds no credential. Grafana’s server-side proxy attaches the signed-in viewer’s own OAuth token to every request (
oauthPassThru). Two viewers of the same dashboard can see different data from the same panel, because each request runs as the person looking at it. - It reads through the gateway’s view route. Every call goes to
/api/v1/v/{viewId}/…, where the Kongosos-accessplugin validates the remainder of the path against that view’s execution plan, checks the caller may access the view, and injects thex-view-idheader itself. The integration can reach only what the view deliberately exposes — a server-side allowlist, not a client-side promise.
If you are building anything that shows platform data to someone else’s eyes, start from this pattern: pass the viewer’s token through, and scope reads to a view.
What the server enforces, whatever the client
Section titled “What the server enforces, whatever the client”The platform does not trust its own UI, so it does not need to trust yours. Four guarantees hold for every caller:
- The permission ladder. Roles, space membership and per-view access are evaluated server-side on every request. One behaviour to know up front: a plain (non-view-scoped) entries list on an entity the identity may not read returns a successful, empty result rather than an error, while a view-scoped path answers
403when the view forbids the operation. - Business rules. Writes from your client enter the same pipeline as writes from the UI: workflow transitions, automation reactions, and the verification challenge that entry creation can demand all still apply.
- Validation. Field and model validation runs server-side and fails with typed, stable error codes — your client’s local checks improve UX, they do not create safety.
- Tenancy scoping. The space is resolved from the host at the gateway and every operation executes inside it. A client cannot address another tenant by adding a header; what identity can and cannot express is the subject of Tenancy and identity.
Who owns what
Section titled “Who owns what”This cluster is deliberately additive. The platform’s existing guides own the ground they already cover, and pages here link to them rather than restating them — where wording ever differs, the owning page wins:
| Concern | Owning guide |
|---|---|
| Routing, URL scheme and versioning, the response envelope, the error body, pagination and filtering conventions, obtaining the OpenAPI specification | Calling the HTTP API |
| The OIDC provider, grant types, the gateway’s authentication plugins, identity-header propagation | Authentication & OAuth |
| Creating an application user and its API token | Adding an application user |
| Regenerating and revoking API tokens | API Tokens · Token lifecycle |
| Sockets from the browser, RTC | Real-Time (Sockets & RTC) |
| Outbound webhooks and inbound integrations | Webhooks & Integrations |
| Reading platform data from Grafana | Grafana Dashboards |
What changed for integrators Since 1.10
Section titled “What changed for integrators Since 1.10”These changes on the 1.10 line affect a headless client directly. Each is covered where it belongs; this is only the pointer:
- Entries now carry an optimistic-concurrency token. Send back the
updateIdentifieryou read and a write that would overwrite someone else’s change fails with409instead of silently winning. It is opt-in per request, and the coverage has known gaps — Writing data has the recipe, Calling the HTTP API has the contract. - A view can publish its own OpenAPI document, five operations wide, which is a narrower and more stable thing to generate a client from than a whole service specification — Generating a client.
GET /v1/collections/{id}serves your own and shared collections, so opening a list you just created no longer answers404— Reading data.- The
entries/value-updatedsocket event carries the entry’s token, so a connected client can notice a conflict before it tries to save — Real-Time. - Refusals that used to answer
500now answer a 4xx with a stable code — re-archiving an archived entity, a hidden workflow action, an unknown filter pointer, an entry create with no body, an expired uploaded file, and more; a 4xx relayed from another service keeps its status (the hidden-action422and the relayed status are alsoSince 1.8) — Calling the HTTP API, with retry guidance in Errors and retries. - Plan limits can refuse creates with
403ENTRY_CAP_EXCEEDED,ENTITY_CAP_EXCEEDED,SPACE_CAP_EXCEEDEDorSTORAGE_CAP_EXCEEDED— never reads, edits or exports — Plan limits. - A tenant under maintenance answers
503 TENANT_IN_MAINTENANCEwithRetry-Afterin a multi-tenant deployment — while its data is restored or it is moved; back off and retry — Tenancy- and space-related refusals. - A tenant’s system administrator can back up, restore and export the tenant’s data through an API (multi-tenant deployments only; no web screen in 1.10) — Tenant backups, restores and exports and Long-running work.
- The gateway now also strips a client’s
x-serviceand clears itsx-view-id— What the gateway strips. - New REST families — the public system-settings read, the WhatsApp template list and webhook, and the packaging routes, which no generated specification contains — Other REST families added in 1.10.
The Endpoint reference has been regenerated from the current OpenAPI snapshots and now lists this cycle’s new operations alongside the rest. Read the operations there rather than from a list in prose — it is generated, so it does not drift.
The pages in this cluster
Section titled “The pages in this cluster”Start here. The Quickstart gets a token and walks through your first authenticated read, the envelope, one real error, one paged read and one create — in under fifteen minutes.
Credentials and identity. Choosing a credential is the decision matrix across the three shapes; Token lifecycle covers refresh, expiry, rotation without downtime and revocation lag; Tenancy and identity explains space scoping and delegation; The security boundary draws the line between what a client may hold and what must stay server-side.
Working with data. Reading data covers the filter dialects, projection and safe paging in depth; Writing data covers creates, updates, bulk operations and their per-row results; Files covers upload, download and the attachment lifecycle; Subscribing connects a non-browser client to the public socket; Long-running work covers job handles, polling, terminal states — and the responses that are downloads, not JSON.
Shipping a client. Errors and retries is the error-code catalogue with a written retry policy; Generating a client turns the per-service OpenAPI documents into typed code; Environments and promotion takes the result from development to production.
Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27