Skip to content

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).

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.

Terminal window
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" }
]
}
  • ETag is a hash of the published theme. Send it back as If-None-Match to get 304 without a body when nothing changed.
  • publishedVersion is 0 for a client whose first version has not been recorded yet (the neutral theme provisioned with the client).
  • warnings lists contrast pairs below the WCAG minimum. They never block a publish.
  • versions has the last 50 published or archived versions, newest first. source is aggregator, back_office or system; 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 (aggregator or back_office) shows who published each version, and ETag/If-Match makes your next write fail with 412 if the theme changed under you.

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.

Terminal window
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 400 and nothing is written. The response names the first blocking problem in error.details.field and reason.
  • logoUrl and faviconUrl must 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 200 with "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.
  • note is optional, at most 280 characters, and is stored with the version.
  • Instead of a full theme you can send baseThemeId and a partial theme: see presets and base themes.
  1. GET the theme and keep etag.
  2. Edit it and PUT with If-Match: <etag> and a new Idempotency-Key.
  3. On 412 someone else published meanwhile: GET again, apply your change on top of the new theme and retry with another key.
  4. On a network error or 5xx retry with the same key and body: the original answer is replayed (Idempotency-Replayed: true) and nothing is published twice.

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:

Terminal window
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 valid is true the answer carries the theme as it would be published (normalised, missing tokens filled in) and any contrast warnings.
  • The order is fixed and the first error is the one a PUT would 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).
  • logoUrl and faviconUrl are checked against the client’s tenant, so an asset that is not an uploaded asset of that tenant is listed.
  • POST /themes/validate is the same call with "clientId" in the body (required there). On the client route clientId may repeat the path’s id; a different one is 400.
  • environment works as in the PUT (a body field, production by default).
  • The back office and overrides.theme of a session keep reporting the first problem only; they are unchanged.

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:

Terminal window
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.

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.

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 _.

Terminal window
# 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 base
curl --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, the theme of a PUT (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. Without theme, 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 404 with error.details.field baseThemeId; a base of another aggregator is also 404.
  • The version note defaults to From base theme {id} and the audit trail records the base used.

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:

Terminal window
# 1. multipart
curl --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 body
curl --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 once
curl --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 https without 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 in error.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, environment and name go in the form fields, the X-Asset-* headers or the JSON body.
Terminal window
# one earlier version, to compare before rolling back
curl --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 version
curl --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.

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).

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 {}.

Terminal window
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 (note Promoted 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 PUT with "environment": "sandbox".
  • changed: false when production already has exactly this theme: nothing is published.
  • 412 carries details.currentEtag (production) or details.currentSourceEtag (sandbox); it is also the answer if either theme changed while the assets were being copied.
  • 409 sandbox_unavailable without hosted sandboxes. A client that is not activated yet can be promoted.

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.

Terminal window
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&currency=USD&preview=1

A 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 launchUrl
const 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.

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
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.