Aggregator theme API
An aggregator can set the published theme of each of its clients without the
back office: colours, fonts, density, layout, experience, light/dark pair, chrome
and components. The published theme is what every visitor sees, including an
anonymous visitor (GET /api/v1/config returns it), so a client no longer opens
with the neutral platform theme until the first player session.
Base URL: https://api.orbisportbook.com/api/v1/aggregator. Authentication,
retries and limits are those of the Aggregator API.
The contract is in the OpenAPI 3.1 file.
GET /api/v1/config revalidates with that theme: it sends a strong ETag and
Cache-Control: no-cache and answers 304 to a matching If-None-Match. A publish
changes the ETag, so no sportsbook keeps an old theme; open ones also get a push and
reload.
A session created with POST /integration/sessions tells you which theme
the player gets: themeVersion is the published version and themeRef is the ETag of this
API without its quotes (or, with an overrides.theme, the reference of the merged theme, with
themeOverridden: true).
Scopes
Section titled “Scopes”| Scope | Capability |
|---|---|
themes:read |
Read the published theme, its history and an earlier version; the presets and your base themes |
themes:write |
Publish a theme and roll back; create, replace and delete base themes |
assets:write |
Upload a logo or favicon |
A key keeps the scopes it was issued with. Keys issued before these scopes
existed do not gain them: issue a new key in the platform Admin (Aggregators)
with themes:read, themes:write and assets:write, switch your job to it and revoke the old one.
Other keys answer 403.
Read the theme
Section titled “Read the theme”curl --fail-with-body -i \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY"?environment=production (default) or ?environment=sandbox picks the client’s
tenant. The response carries the ETag header and the same value in the body:
{ "environment": "production", "etag": "\"c9a5135d41212def3c0d062e330c5cbf\"", "publishedVersion": 3, "theme": { "name": "CW blue", "density": "compact", "layout": "three-column", "experience": "rail", "tokens": { "color-brand": "#1c2733", "color-accent": "#0b5cff" } }, "warnings": [], "versions": [ { "version": 3, "status": "published", "note": "CW launch theme", "source": "aggregator", "createdAt": "2026-11-08T17:41:54Z", "publishedAt": "2026-11-08T17:41:54Z" }, { "version": 2, "status": "archived", "note": "", "source": "back_office", "createdAt": "2026-11-02T10:00:00Z", "publishedAt": "2026-11-02T10:00:00Z" } ]}ETagis a hash of the published theme. Send it back asIf-None-Matchto get304without a body when nothing changed.publishedVersionis0for a client whose first version has not been recorded yet (the neutral theme provisioned with the client).warningslists contrast pairs below the WCAG minimum. They never block a publish.versionshas the last 50 published or archived versions, newest first.sourceisaggregator,back_officeorsystem; staff identities are never returned. Back-office drafts are never read or touched by this API.- If the brand’s staff also use the Theme Studio, agree who owns the theme. A Theme Studio draft is
independent of this API: publishing a draft saved before your publish replaces the theme you
published through the API, without warning.
versions[].source(aggregatororback_office) shows who published each version, andETag/If-Matchmakes your next write fail with412if the theme changed under you.
Publish a theme
Section titled “Publish a theme”PUT replaces the published theme and publishes it at once. It needs two headers:
an Idempotency-Key and an If-Match with the ETag you read, so one writer
never overwrites another’s change.
curl --fail-with-body -i -X PUT \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: casino-42-theme-v7' \ -H 'If-Match: "c9a5135d41212def3c0d062e330c5cbf"' \ -d '{ "environment": "production", "note": "CW launch theme", "theme": { "name": "CW blue", "density": "compact", "layout": "three-column", "tokens": { "color-brand": "#1c2733", "color-accent": "#0b5cff" } } }'200 response:
{ "environment": "production", "changed": true, "version": 4, "previousVersion": 3, "etag": "\"5be0e3e5f4b53a3a0c9d4f1e22a7f9b0\"", "theme": { "name": "CW blue", "density": "compact", "layout": "three-column", "tokens": { "color-accent": "#0b5cff" } }}- It is a replacement, not a patch. Tokens you omit are filled from the neutral defaults. To change one value, read the theme, edit it and send it back whole.
- It is validated and versioned exactly like a Theme Studio publish: token names,
colour formats, curated fonts, size bounds, contrast, the trade-dress guardrail
and the asset rules. A rejected theme is a
400and nothing is written. The response names the first blocking problem inerror.details.fieldandreason. logoUrlandfaviconUrlmust be uploaded assets of the same tenant (/api/v1/assets/{tenantId}/{assetId}), as in the back office. Upload them with the asset endpoint first.- If the validated theme equals the live one, the answer is
200with"changed": false: no version, no reload. - When it changes, every open sportsbook of that tenant reloads its configuration.
- Each publish is audited: aggregator, key, environment, version, previous version, the ETags before and after, and the note.
noteis optional, at most 280 characters, and is stored with the version.- Instead of a full
themeyou can sendbaseThemeIdand a partial theme: see presets and base themes.
A safe update loop
Section titled “A safe update loop”GETthe theme and keepetag.- Edit it and
PUTwithIf-Match: <etag>and a newIdempotency-Key. - On
412someone else published meanwhile:GETagain, apply your change on top of the new theme and retry with another key. - On a network error or
5xxretry with the same key and body: the original answer is replayed (Idempotency-Replayed: true) and nothing is published twice.
Check a theme before publishing
Section titled “Check a theme before publishing”POST /clients/{id}/theme/validate is a dry run of the PUT. It writes nothing,
creates no version, is not audited and needs no Idempotency-Key. Either theme
scope may use it. It answers 200 with every blocking problem at once, not only
the first:
curl --fail-with-body \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme/validate" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"theme":{"name":"CW blue","density":"huge","layout":"three-column","tokens":{"color-bg":"banana","row-height":"200px"}}}'{ "environment": "production", "valid": false, "errors": [ { "field": "theme.density", "reason": "invalid_enum", "message": "density must be compact or comfortable", "details": { "allowed": ["compact", "comfortable"] } }, { "field": "theme.tokens.color-bg", "reason": "invalid_color", "message": "token \"color-bg\" is not a valid colour (hex, rgb(a) or hsl(a))", "details": { "token": "color-bg" } }, { "field": "theme.tokens.row-height", "reason": "out_of_bounds", "message": "token \"row-height\" must be between 36px and 64px", "details": { "token": "row-height", "min": 36, "max": 64 } } ], "warnings": [], "rulesVersion": "r3ffb78215ce0"}- When
validistruethe answer carries thethemeas it would be published (normalised, missing tokens filled in) and any contrastwarnings. - The order is fixed and the first error is the one a
PUTwould answer with. - A problem that depends on a value that is itself invalid is left out until that value is fixed (the trade-dress check does not run on a colour that did not parse).
logoUrlandfaviconUrlare checked against the client’s tenant, so an asset that is not an uploaded asset of that tenant is listed.POST /themes/validateis the same call with"clientId"in the body (required there). On the client routeclientIdmay repeat the path’s id; a different one is400.environmentworks as in thePUT(a body field,productionby default).- The back office and
overrides.themeof a session keep reporting the first problem only; they are unchanged.
The schema
Section titled “The schema”GET /themes/schema returns the JSON Schema (2020-12) of a theme and of a session’s
overrides.theme, built from the validator’s own tables, with the current
rulesVersion:
curl --fail-with-body \ "https://api.orbisportbook.com/api/v1/aggregator/themes/schema" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY"{ "rulesVersion": "r3ffb78215ce0", "theme": { … }, "themeOverride": { … } }.
theme is the body of a PUT; themeOverride is the same shape with every field
optional, merged over the published theme for one session. They are also
components.schemas.Theme and ThemeOverride of the
OpenAPI contract. A schema cannot say
everything: contrast is a warning, the trade-dress guardrail and the ownership of an
asset are checked by the API.
Validation rules and their changelog
Section titled “Validation rules and their changelog”The rules (token names, curated fonts, size bounds, contrast pairs, component and
chrome options, the trade-dress guardrail, the asset limits) are identified by a
rulesVersion, a short hash of every table the validator reads. It comes in every
validation answer and in GET /themes/schema. Keep the version you last validated
against; when it changes, validate your stored themes again (a rollback also
validates the old theme against the current rules).
A new version is a published change: it is added to this table before it is deployed.
rulesVersion |
Date | What changed |
|---|---|---|
r3ffb78215ce0 |
2026-11-08 | First published version: the rules described in this guide. |
Presets and base themes
Section titled “Presets and base themes”GET /themes/presets lists the platform’s reference theme of each sportsbook
experience (classic, cards, panels, dense, rail): the neutral theme with the
experience set and its reference palette. They are the same presets the web client uses.
A preset is only a starting point; copy one into a base theme or into a PUT.
Each preset also has a description (what the experience looks like) and changes
(the tokens it sets over the neutral theme; empty for classic). Every other token keeps
your value, and every experience honours radius and row-height.
GET /themes/fonts lists the curated fonts (id, label, stack). font-family must be
one font’s stack, exactly; the same list is in the schema as x-fonts.
A base theme is a theme you keep once and start many clients from. They live in your
aggregator, not in a client, so they hold no logoUrl or faviconUrl (an asset
belongs to one client; set them when you apply the theme). At most 50 per aggregator;
the id has 2–40 lower-case letters, digits, - or _.
# create (If-None-Match: * means "only if it does not exist")curl --fail-with-body -X PUT \ "https://api.orbisportbook.com/api/v1/aggregator/themes/bases/cw-base" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: base-cw-base-v1' \ -H 'If-None-Match: *' \ -d '{"name":"CW base","theme":{"name":"CW rail","density":"compact","layout":"three-column","experience":"rail","tokens":{"color-accent":"#0b5cff"}}}'
# apply it to a client: a partial theme over a COPY of the basecurl --fail-with-body -X PUT \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: casino-42-theme-v8' \ -H 'If-Match: "c9a5135d41212def3c0d062e330c5cbf"' \ -d '{"baseThemeId":"cw-base","theme":{"name":"Casino 42","logoUrl":"/api/v1/assets/ob_generated/as_9f2c7d1e4b6a8c30d5e1f27a"}}'| Route | What it does |
|---|---|
GET /themes/bases |
List your base themes with their ETags (themes:read) |
GET /themes/bases/{id} |
One base theme, with ETag and If-None-Match (themes:read) |
PUT /themes/bases/{id} |
Create with If-None-Match: *; replace with If-Match: <etag> (themes:write) |
DELETE /themes/bases/{id} |
Delete with If-Match: <etag> (themes:write) |
Writes need an Idempotency-Key and one of the two preconditions (428 if you send
neither, 412 if the base already exists or changed; the error carries
details.currentEtag).
- Applying is copying. With
baseThemeId, thethemeof aPUT(or of a dry run) becomes an optional partial theme merged over the base as it is when the request is applied: the fields you set replace the base’s, tokens and component properties are merged key by key. Withouttheme, the base is applied as it is. The result is validated for the client like any theme. - Afterwards the client’s theme is its own. Editing or deleting a base never changes a client that already has the copy; apply the base again to move a client.
- An unknown base is
404witherror.details.fieldbaseThemeId; a base of another aggregator is also404. - The version note defaults to
From base theme {id}and the audit trail records the base used.
Upload the logo and favicon
Section titled “Upload the logo and favicon”POST /clients/{id}/assets stores an image in the client’s tenant and returns the
url to use as logoUrl or faviconUrl. It needs an Idempotency-Key and, like the
theme, an environment (production by default). Pick one of three forms:
# 1. multipartcurl --fail-with-body \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/assets" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Idempotency-Key: casino-42-logo-v1' \ -F kind=logo -F name='CW logo' -F file=@logo.png
# 2. the image as the bodycurl --fail-with-body -X POST \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/assets" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Idempotency-Key: casino-42-favicon-v1' \ -H 'Content-Type: image/png' -H 'X-Asset-Kind: favicon' \ --data-binary @favicon.png
# 3. let the server download an https image oncecurl --fail-with-body -X POST \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/assets" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Idempotency-Key: casino-42-logo-v2' \ -H 'Content-Type: application/json' \ -d '{"kind":"logo","url":"https://cdn.example.com/cw/logo.png?v=3"}'{ "environment": "production", "asset": { "id": "as_9f2c7d1e4b6a8c30d5e1f27a", "url": "/api/v1/assets/ob_generated/as_9f2c7d1e4b6a8c30d5e1f27a", "kind": "logo", "contentType": "image/png", "size": 8214, "width": 320, "height": 80, "name": "CW logo", "sha256": "11cd70c6…" }}Then publish the theme with "logoUrl": "<asset.url>".
| Kind | Format | Size | Dimensions |
|---|---|---|---|
logo |
PNG, JPEG or WebP | up to 512 KB | 16–4096 px per side, aspect ratio up to 12 (320×80 recommended) |
favicon |
PNG, JPEG or WebP | up to 128 KB | 16–1024 px per side, roughly square (64×64 recommended) |
- No SVG and no ICO. Convert them to PNG, JPEG or WebP before uploading. The type is decided from the file’s bytes, not from the declared type or the extension.
- The same file uploaded again for the same tenant and kind returns the same asset.
- URL form. The server downloads the image once and keeps its own copy; the URL
is never stored or served, and the audit trail keeps only its host. It must be
httpswithout credentials (a query string is fine). The connection refuses private, loopback and link-local addresses whatever the name resolves to, follows no redirect, gives up after 10 seconds and stops at the size limit. Failures say why inerror.details.reason:invalid_url,destination_not_allowed,redirect_refused,unreachable,too_large,status_*. - Refusals of the image itself:
empty,too_large,dimensions,svg_not_allowed,unsupported_type,invalid_kind. - Query parameters are not accepted:
kind,environmentandnamego in the form fields, theX-Asset-*headers or the JSON body.
History and rollback
Section titled “History and rollback”# one earlier version, to compare before rolling backcurl --fail-with-body \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme/versions/2" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY"
# publish version 2 again, as a new versioncurl --fail-with-body -X POST \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme/rollback" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: casino-42-theme-rollback-1' \ -H 'If-Match: "5be0e3e5f4b53a3a0c9d4f1e22a7f9b0"' \ -d '{"environment":"production","version":2,"note":"Back to the launch theme"}'A rollback publishes the old theme as a new version, so the history only grows.
The old theme is validated again against today’s rules (400 if they have tightened).
Rolling back to the version that is already live is 409 (details.reason
already_published); an unknown version, or a draft, is 404.
Sandbox and production
Section titled “Sandbox and production”Each client has two tenants. environment picks one (production by default);
they have separate themes, histories and ETags, and a sandbox publish never
touches production. Use sandbox to try a theme with a launched session before
publishing it to production. sandbox needs hosted sandboxes; otherwise it is
409 (details.reason sandbox_unavailable). To see a sandbox theme with a player, launch a session in the
sandbox with overrides.theme; when it is right, promote it. A client that is not activated yet
can already have its theme set.
environment is a query parameter in GET requests and a body field in PUT and
POST (mutations do not accept query parameters).
Promote the sandbox theme to production
Section titled “Promote the sandbox theme to production”Each client keeps separate themes in its two tenants, so a theme is usually prepared and
checked in the sandbox ("environment": "sandbox") and then published to production.
POST /clients/{id}/theme/promote does that in one step. It needs themes:write, an
Idempotency-Key, and the If-Match of the production theme you read. sourceEtag is the
ETag of the sandbox theme you looked at (optional, recommended): if the sandbox theme is
different now, the answer is 412 and nothing is promoted. The body is a JSON object; it may be {}.
curl --fail-with-body -X POST \ "https://api.orbisportbook.com/api/v1/aggregator/clients/$CLIENT_ID/theme/promote" \ -H "Authorization: Bearer $AGGREGATOR_API_KEY" \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: casino-42-promote-1' \ -H 'If-Match: "c9a5135d41212def3c0d062e330c5cbf"' \ -d '{"sourceEtag":"\"5be0e3e5f4b53a3a0c9d4f1e22a7f9b0\"","note":"Launch theme"}'{ "environment": "production", "changed": true, "version": 5, "previousVersion": 4, "etag": "\"b1c2d3e4f5a60718293a4b5c6d7e8f90\"", "theme": { "name": "CW blue", "logoUrl": "/api/v1/assets/ob_generated/as_1f6a35fd8ee8a62e9f90dbe9", "…": "…" }, "promotedFrom": { "environment": "sandbox", "version": 3, "etag": "\"5be0e3e5f4b53a3a0c9d4f1e22a7f9b0\"" }, "assets": [ { "kind": "logo", "sandboxAssetId": "as_593cc76b80f277533a060cc7", "assetId": "as_1f6a35fd8ee8a62e9f90dbe9", "url": "/api/v1/assets/ob_generated/as_1f6a35fd8ee8a62e9f90dbe9" } ]}- It publishes through the same path as a
PUT: the same validation, a new production version (notePromoted from sandbox v{N}by default), the same audit trail, and the usual reload of open sportsbooks. Undo it with the rollback of production. - Assets are copied, not shared. An asset belongs to one tenant, so the sandbox theme’s logo and
favicon are copied into the production tenant (the same bytes give the same asset there, so a
second promotion does not duplicate them) and the production theme points at the copies, listed in
assets. The sandbox is untouched. - Only sandbox to production: the other direction is a
PUTwith"environment": "sandbox". changed: falsewhen production already has exactly this theme: nothing is published.412carriesdetails.currentEtag(production) ordetails.currentSourceEtag(sandbox); it is also the answer if either theme changed while the assets were being copied.409sandbox_unavailablewithout hosted sandboxes. A client that is not activated yet can be promoted.
Preview a theme live in your back office
Section titled “Preview a theme live in your back office”To let a person try colours and fonts in your back office without a reload and without
spending the aggregator’s 120 requests per minute, frame a preview session and push the
theme with postMessage. Nothing is published, saved or counted: a reload shows the real theme.
1. Allow your back office. List the page’s origin in the client’s previewOrigins
(PATCH /clients/{id}, scope clients:update, a reason, Idempotency-Key and If-Match),
like embedOrigins: https://host[:port], at most 20, no path, no wildcard, http only in development.
[] clears the list. The change is audited with the old and the new list.
curl -X PATCH "$BASE/clients/$CLIENT" \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" -H "If-Match: $ETAG" \ -d '{ "previewOrigins": ["https://backoffice.casino.example"], "reason": "Theme preview in our back office" }'2. Open a preview session. Create the session as usual (POST /integration/sessions,
sandbox or production) and add preview=1 to the launchUrl you frame:
https://api.orbisportbook.com/?tenant=...&launch=lt_...&path=%2F&locale=en¤cy=USD&preview=1A session without preview=1 is a normal session: it ignores theme:apply. A preview
session shows a small “Preview” badge. The launchUrl is single use and valid for 120 seconds
(opening it again answers 401 launch_token_used), so create a new session for each iframe. You do not need a new session to change the theme: send theme:apply again. If the iframe reloads, it shows the real theme until you send the theme again after the next theme:ready.
3. Push the theme. The iframe sends { "type": "theme:ready" } to your page when it will
listen (its config, with previewOrigins, has loaded). Then:
const frame = document.getElementById('sportsbook'); // the iframe with the launchUrlconst SPORTSBOOK = 'https://api.orbisportbook.com'; // origin of the launchUrl
addEventListener('message', (e) => { if (e.origin !== SPORTSBOOK || e.source !== frame.contentWindow) return; if (e.data.type === 'theme:ready') apply({ tokens: { 'color-accent': '#c8401f', radius: '12px' } }); if (e.data.type === 'theme:applied') console.log('applied', e.data.id); if (e.data.type === 'theme:error') console.warn(e.data.id, e.data.errors); // [{ code, message }, ...]});
function apply(theme) { // never '*': only the sportsbook's origin receives the theme frame.contentWindow.postMessage({ type: 'theme:apply', id: crypto.randomUUID(), theme }, SPORTSBOOK);}| Message | Direction | Content |
|---|---|---|
theme:apply |
your page → iframe | theme: a theme patch, as in overrides.theme (tokens, logoUrl, faviconUrl, density, layout, experience, scheme, chrome, components), shown over the launch’s or published theme. null clears the preview. Optional id (up to 64 characters), echoed in the answer. |
theme:applied |
iframe → your page | id if sent. The theme is on screen. |
theme:error |
iframe → your page | errors: every problem, [{ code, message }]. Nothing was applied. |
theme:ready |
iframe → your page | The iframe listens now. |
Error code: invalid_theme (the same rules as overrides.theme: unknown
field or token, invalid value, a logo or favicon outside the brand’s media library, a trade-dress
clash, and so on),
too_large (more than 64 KiB of JSON) and rate_limited (more than 10 messages per second).
The iframe hears only window.parent, and only when its origin is in previewOrigins; any
other message is ignored without an answer, and answers go to your origin, never *. Only the theme
changes. Content, currency, display and anything that touches a player stay as the session was created.
Look at the result, then publish with PUT /theme.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| JSON body | 64 KiB; unknown fields are refused |
| Image upload | 512 KB logo, 128 KB favicon |
| Rate | 120 requests per minute per aggregator, across its keys |
| History returned | 50 versions |
note |
280 characters |
| Theme name | 1–64 characters |
Live preview (theme:apply) |
10 messages per second, theme up to 64 KiB of JSON, previewOrigins up to 20 |
Errors
Section titled “Errors”| HTTP | Meaning and handling |
|---|---|
400 |
Invalid body, header or theme (error.details.field, reason), a * or weak If-Match, unknown query parameter or environment, or a missing Idempotency-Key |
401 |
Expired or revoked key, or disabled or expired authorization |
403 |
Scope not granted, or the request carried an Origin header |
404 |
Client does not exist or belongs to another aggregator; unknown version or draft |
409 |
Key reused with another request or after the replay expired; rollback to the live version; sandbox unavailable |
412 |
If-Match is stale. error.details.currentEtag is the current ETag: read again |
428 |
If-Match is missing |
429 |
Respect Retry-After and repeat with the same idempotency key |
5xx / timeout |
Retry with backoff and the same key |
This API changes how a client looks. It does not touch wallets, balances, bets, limits or currencies.