Set branding
const url = 'https://api.keliplay.com/v1/tenant/branding';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"colors":{"bg":"#ffffff","fg":"#1a1a2e","accent":"#3b8ad9"},"logoUrl":"https://cdn.example.com/brand/logo.png","fontFamily":"Inter, sans-serif","labels":{"play":"Play now"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.keliplay.com/v1/tenant/branding \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "colors": { "bg": "#ffffff", "fg": "#1a1a2e", "accent": "#3b8ad9" }, "logoUrl": "https://cdn.example.com/brand/logo.png", "fontFamily": "Inter, sans-serif", "labels": { "play": "Play now" } }'Replaces your account’s theme. Fields you leave out are cleared. At most 40 labels.
If your plan does not include custom branding or custom copy, players see the default look or wording instead. Your saved theme is kept.
Permission: branding.write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Colours, images, font, wording, background, position and decorations for your games.
Each file must be the kind its field takes: logoUrl and backgroundUrl an image,
an animation or decoration the kind it names. A file from your media library is
checked by its type, any other address by its file extension. A mismatch is a
400 naming the field.
object
Six-digit hex colours, such as #3b8ad9.
object
An https URL, or a file from your media library.
The background image, or an animation’s still. An https URL, or a file from your media library.
A CSS font family list. Letters, digits, spaces, quotes, commas and hyphens.
Where to load the font from.
Your own wording for player-facing text, keyed by label. Each game lists its label keys in labelKeys.
object
Where the game sits when it fills a phone’s screen. Has no effect inside a website’s frame.
object
Defaults to center.
game keeps each game’s own width, wide allows at least 560 pixels, full uses the whole screen.
How the background is painted, on the pre-game page, the game and the reward page.
object
How backgroundUrl fills the screen. Defaults to cover.
The part of the image kept in view when it is cropped. Defaults to center.
Painted in place of the flat colors.bg.
object
A tint over the background, for legibility.
object
Percent.
Moving art from your media library. backgroundUrl is shown first, and
instead when motion is off, data is being saved, or it cannot play.
Videos play muted, only when the game fills a phone’s screen.
object
Artwork along the top and bottom edges. It never covers the game.
object
object
An https URL, or a file from your media library. An image repeats along its edge.
The height of its band, 48, 96 or 160 pixels.
object
An https URL, or a file from your media library. An image repeats along its edge.
The height of its band, 48, 96 or 160 pixels.
Example
{ "colors": { "bg": "#ffffff", "fg": "#1a1a2e", "accent": "#3b8ad9" }, "logoUrl": "https://cdn.example.com/brand/logo.png", "fontFamily": "Inter, sans-serif", "labels": { "play": "Play now" }}Responses
Section titled “Responses”The saved theme.
object
Colours, images, font, wording, background, position and decorations for your games.
Each file must be the kind its field takes: logoUrl and backgroundUrl an image,
an animation or decoration the kind it names. A file from your media library is
checked by its type, any other address by its file extension. A mismatch is a
400 naming the field.
object
Six-digit hex colours, such as #3b8ad9.
object
An https URL, or a file from your media library.
The background image, or an animation’s still. An https URL, or a file from your media library.
A CSS font family list. Letters, digits, spaces, quotes, commas and hyphens.
Where to load the font from.
Your own wording for player-facing text, keyed by label. Each game lists its label keys in labelKeys.
object
Where the game sits when it fills a phone’s screen. Has no effect inside a website’s frame.
object
Defaults to center.
game keeps each game’s own width, wide allows at least 560 pixels, full uses the whole screen.
How the background is painted, on the pre-game page, the game and the reward page.
object
How backgroundUrl fills the screen. Defaults to cover.
The part of the image kept in view when it is cropped. Defaults to center.
Painted in place of the flat colors.bg.
object
A tint over the background, for legibility.
object
Percent.
Moving art from your media library. backgroundUrl is shown first, and
instead when motion is off, data is being saved, or it cannot play.
Videos play muted, only when the game fills a phone’s screen.
object
Artwork along the top and bottom edges. It never covers the game.
object
object
An https URL, or a file from your media library. An image repeats along its edge.
The height of its band, 48, 96 or 160 pixels.
object
An https URL, or a file from your media library. An image repeats along its edge.
The height of its band, 48, 96 or 160 pixels.
Example
{ "theme": { "colors": { "bg": "#ffffff", "fg": "#1a1a2e", "accent": "#3b8ad9" }, "logoUrl": "https://cdn.example.com/brand/logo.png", "fontFamily": "Inter, sans-serif", "labels": { "play": "Play now" } }}The request is not valid. details lists each field that failed, where there is one.
object
object
Stable and safe to branch on.
invalid_request(400): the request is not valid.unauthorized(401): missing, malformed or revoked API key.upgrade_required(402): not in your plan, or a plan limit is reached.forbidden(403): the key lacks a permission, or the action is not allowed.not_found(404): nothing with that id in your account.conflict(409): clashes with the current state.confirmation_required(409): repeat withconfirm=true. Folder deletion only.rate_limited(429): wait forRetry-Afterseconds.internal_error(500) andservice_unavailable(503): try again later.
Written for a person. May change; do not parse it.
object
The failing field, dot separated, such as prize.label.
object
Example
{ "error": { "code": "invalid_request", "message": "Invalid request json.", "details": [ { "path": "name", "message": "Too small, expected string to have >=1 characters" } ] }}The API key is missing, malformed or revoked.
object
object
Stable and safe to branch on.
invalid_request(400): the request is not valid.unauthorized(401): missing, malformed or revoked API key.upgrade_required(402): not in your plan, or a plan limit is reached.forbidden(403): the key lacks a permission, or the action is not allowed.not_found(404): nothing with that id in your account.conflict(409): clashes with the current state.confirmation_required(409): repeat withconfirm=true. Folder deletion only.rate_limited(429): wait forRetry-Afterseconds.internal_error(500) andservice_unavailable(503): try again later.
Written for a person. May change; do not parse it.
object
The failing field, dot separated, such as prize.label.
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or revoked API key." }}The API key does not carry the permission this needs, or the request is not allowed.
object
object
Stable and safe to branch on.
invalid_request(400): the request is not valid.unauthorized(401): missing, malformed or revoked API key.upgrade_required(402): not in your plan, or a plan limit is reached.forbidden(403): the key lacks a permission, or the action is not allowed.not_found(404): nothing with that id in your account.conflict(409): clashes with the current state.confirmation_required(409): repeat withconfirm=true. Folder deletion only.rate_limited(429): wait forRetry-Afterseconds.internal_error(500) andservice_unavailable(503): try again later.
Written for a person. May change; do not parse it.
object
The failing field, dot separated, such as prize.label.
object
Example
{ "error": { "code": "forbidden", "message": "Your role does not allow this (draws.run)." }}