Create a theme
POST/v2/themes
const url = 'https://api.ligr.live/rest/v2/themes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","sports":["football"],"variables":[{"id":"example","name":"example","type":"string","defaultValue":"example","description":"example","enumOptions":["example"],"isStyle":true}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v2/themes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "sports": [ "football" ], "variables": [ { "id": "example", "name": "example", "type": "string", "defaultValue": "example", "description": "example", "enumOptions": [ "example" ], "isStyle": true } ] }'Beta. This operation can change between minor versions. See Beta status.
Creates a theme your organization owns. The theme appears on the Themes page of the dashboard and in the competition theme picker like any other theme, once a theme version is active. Your organization can own up to five themes.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Body of POST /v2/themes.
object
Sport keys the theme supports, for example ["football"]. At least one.
Theme variables the graphics can read. Default: none.
A theme variable an operator sets per competition: a colour, a label or a sponsor name.
object
Use the same string as name.
Unique within the theme.
The value in force when a competition sets nothing.
Required for enum, at least one option.
True when the variable holds a colour, a font or another style value.
Responses
Section titled “Responses”Created
object
Entity identifier
Theme version the overlays render. Null means no version is active.
Published theme version numbers, in ascending order.
object
Stable graphic identifier. It does not change between versions.
code or rive.
Version number of the editable working copy.
Published version numbers, in ascending order.
Examplegenerated
{ "id": 1, "name": "example", "activeVersion": 1, "versions": [ 1 ], "graphics": [ { "graphicId": "example", "name": "example", "type": "example", "workingVersion": 1, "publishedVersions": [ 1 ] } ]}Request is invalid
object
object
Examplegenerated
{ "message": "example", "details": { "additionalProperty": "example" }}Missing or invalid api key
object
Examplegenerated
{ "message": "example"}Api key provides insufficient access for the request
object
Examplegenerated
{ "message": "example"}Theme not found
object
Examplegenerated
{ "message": "example"}Your organization owns as many themes as it can create
Body of a 409 answer when the organization owns as many themes as it can create.
code is always THEME_LIMIT_REACHED.
object
Examplegenerated
{ "message": "example", "code": "example"}Api key has made too many requests
object
Examplegenerated
{ "message": "example"}An unexpected error has occured. If problems persist please contact support
object
Examplegenerated
{ "message": "example"}