Skip to content

Set branding

PUT
/v1/tenant/branding
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.

Media typeapplication/json

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
colors

Six-digit hex colours, such as #3b8ad9.

object
bg
string
/^#[0-9a-fA-F]{6}$/
fg
string
/^#[0-9a-fA-F]{6}$/
muted
string
/^#[0-9a-fA-F]{6}$/
accent
string
/^#[0-9a-fA-F]{6}$/
danger
string
/^#[0-9a-fA-F]{6}$/
surface
string
/^#[0-9a-fA-F]{6}$/
border
string
/^#[0-9a-fA-F]{6}$/
logoUrl

An https URL, or a file from your media library.

string
<= 2048 characters
backgroundUrl

The background image, or an animation’s still. An https URL, or a file from your media library.

string
<= 2048 characters
fontFamily

A CSS font family list. Letters, digits, spaces, quotes, commas and hyphens.

string
>= 1 characters <= 120 characters /^[\w ,'"-]+$/
fontUrl

Where to load the font from.

string
<= 2048 characters
labels

Your own wording for player-facing text, keyed by label. Each game lists its label keys in labelKeys.

object
<= 40 properties
key
additional properties
string
<= 200 characters
layout

Where the game sits when it fills a phone’s screen. Has no effect inside a website’s frame.

object
position

Defaults to center.

string
Allowed values: top center bottom
width

game keeps each game’s own width, wide allows at least 560 pixels, full uses the whole screen.

string
Allowed values: game wide full
background

How the background is painted, on the pre-game page, the game and the reward page.

object
fit

How backgroundUrl fills the screen. Defaults to cover.

string
Allowed values: cover contain tile
focus

The part of the image kept in view when it is cropped. Defaults to center.

string
Allowed values: top-left top top-right left center right bottom-left bottom bottom-right
gradient

Painted in place of the flat colors.bg.

object
from
required
string
/^#[0-9a-fA-F]{6}$/
to
required
string
/^#[0-9a-fA-F]{6}$/
angle
required
integer
<= 359
overlay

A tint over the background, for legibility.

object
color
required
string
/^#[0-9a-fA-F]{6}$/
opacity
required

Percent.

integer
<= 80
animation

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
kind
required
string
Allowed values: lottie video
url
required
string
<= 2048 characters
decorations

Artwork along the top and bottom edges. It never covers the game.

object
top
object
url
required

An https URL, or a file from your media library. An image repeats along its edge.

string
<= 2048 characters
kind
required
string
Allowed values: image lottie
size
required

The height of its band, 48, 96 or 160 pixels.

string
Allowed values: small medium large
bottom
object
url
required

An https URL, or a file from your media library. An image repeats along its edge.

string
<= 2048 characters
kind
required
string
Allowed values: image lottie
size
required

The height of its band, 48, 96 or 160 pixels.

string
Allowed values: small medium large
Example
{
"colors": {
"bg": "#ffffff",
"fg": "#1a1a2e",
"accent": "#3b8ad9"
},
"logoUrl": "https://cdn.example.com/brand/logo.png",
"fontFamily": "Inter, sans-serif",
"labels": {
"play": "Play now"
}
}

The saved theme.

Media typeapplication/json
object
theme
required

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
colors

Six-digit hex colours, such as #3b8ad9.

object
bg
string
/^#[0-9a-fA-F]{6}$/
fg
string
/^#[0-9a-fA-F]{6}$/
muted
string
/^#[0-9a-fA-F]{6}$/
accent
string
/^#[0-9a-fA-F]{6}$/
danger
string
/^#[0-9a-fA-F]{6}$/
surface
string
/^#[0-9a-fA-F]{6}$/
border
string
/^#[0-9a-fA-F]{6}$/
logoUrl

An https URL, or a file from your media library.

string
<= 2048 characters
backgroundUrl

The background image, or an animation’s still. An https URL, or a file from your media library.

string
<= 2048 characters
fontFamily

A CSS font family list. Letters, digits, spaces, quotes, commas and hyphens.

string
>= 1 characters <= 120 characters /^[\w ,'"-]+$/
fontUrl

Where to load the font from.

string
<= 2048 characters
labels

Your own wording for player-facing text, keyed by label. Each game lists its label keys in labelKeys.

object
<= 40 properties
key
additional properties
string
<= 200 characters
layout

Where the game sits when it fills a phone’s screen. Has no effect inside a website’s frame.

object
position

Defaults to center.

string
Allowed values: top center bottom
width

game keeps each game’s own width, wide allows at least 560 pixels, full uses the whole screen.

string
Allowed values: game wide full
background

How the background is painted, on the pre-game page, the game and the reward page.

object
fit

How backgroundUrl fills the screen. Defaults to cover.

string
Allowed values: cover contain tile
focus

The part of the image kept in view when it is cropped. Defaults to center.

string
Allowed values: top-left top top-right left center right bottom-left bottom bottom-right
gradient

Painted in place of the flat colors.bg.

object
from
required
string
/^#[0-9a-fA-F]{6}$/
to
required
string
/^#[0-9a-fA-F]{6}$/
angle
required
integer
<= 359
overlay

A tint over the background, for legibility.

object
color
required
string
/^#[0-9a-fA-F]{6}$/
opacity
required

Percent.

integer
<= 80
animation

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
kind
required
string
Allowed values: lottie video
url
required
string
<= 2048 characters
decorations

Artwork along the top and bottom edges. It never covers the game.

object
top
object
url
required

An https URL, or a file from your media library. An image repeats along its edge.

string
<= 2048 characters
kind
required
string
Allowed values: image lottie
size
required

The height of its band, 48, 96 or 160 pixels.

string
Allowed values: small medium large
bottom
object
url
required

An https URL, or a file from your media library. An image repeats along its edge.

string
<= 2048 characters
kind
required
string
Allowed values: image lottie
size
required

The height of its band, 48, 96 or 160 pixels.

string
Allowed values: small medium large
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.

Media typeapplication/json
object
error
required
object
code
required

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 with confirm=true. Folder deletion only.
  • rate_limited (429): wait for Retry-After seconds.
  • internal_error (500) and service_unavailable (503): try again later.
string
Allowed values: invalid_request unauthorized upgrade_required forbidden not_found conflict confirmation_required rate_limited internal_error service_unavailable
message
required

Written for a person. May change; do not parse it.

string
details
One of:
Array<object>
object
path
required

The failing field, dot separated, such as prize.label.

string
message
required
string
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.

Media typeapplication/json
object
error
required
object
code
required

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 with confirm=true. Folder deletion only.
  • rate_limited (429): wait for Retry-After seconds.
  • internal_error (500) and service_unavailable (503): try again later.
string
Allowed values: invalid_request unauthorized upgrade_required forbidden not_found conflict confirmation_required rate_limited internal_error service_unavailable
message
required

Written for a person. May change; do not parse it.

string
details
One of:
Array<object>
object
path
required

The failing field, dot separated, such as prize.label.

string
message
required
string
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.

Media typeapplication/json
object
error
required
object
code
required

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 with confirm=true. Folder deletion only.
  • rate_limited (429): wait for Retry-After seconds.
  • internal_error (500) and service_unavailable (503): try again later.
string
Allowed values: invalid_request unauthorized upgrade_required forbidden not_found conflict confirmation_required rate_limited internal_error service_unavailable
message
required

Written for a person. May change; do not parse it.

string
details
One of:
Array<object>
object
path
required

The failing field, dot separated, such as prize.label.

string
message
required
string
Example
{
"error": {
"code": "forbidden",
"message": "Your role does not allow this (draws.run)."
}
}