Skip to content

Create a theme variable

POST/v2/themes/{themeId}/variables

POST
/v2/themes/{themeId}/variables
curl --request POST \
--url https://api.ligr.live/rest/v2/themes/1/variables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "ifUnchangedSince": "example", "name": "example", "type": "string", "defaultValue": "example", "description": "example", "enumOptions": [ "example" ], "isStyle": true }'

Beta. This operation can change between minor versions. See Beta status.

Adds one variable to a theme. The id takes the value of the name. A name already used in the theme answers 400.

themeId
required
number format: double

The theme identifier

Media typeapplication/json

Body of POST /v2/themes/{themeId}/variables.

object
ifUnchangedSince
string
name
required

Unique within the theme. The id takes the same value.

string
>= 1 characters <= 64 characters
type
required
string
Allowed values: string number boolean enum
defaultValue
string
nullable
description
string
nullable
enumOptions

Required for enum, at least one option.

Array<string>
nullable
isStyle
boolean

Created

Media typeapplication/json

Response of POST and PATCH on a theme variable.

updatedAt is the theme’s new updatedAt after this write. Send it back as ifUnchangedSince on the next write, in place of a fresh list read.

object
id
required

Equal to name for a variable this API created.

string
name
required
string
type
required
string
Allowed values: string number boolean enum
defaultValue
required

The value in force when a competition sets nothing. Null means no default.

string
nullable
description
required
string
nullable
enumOptions
required

Allowed values of an enum variable. Null for the other types.

Array<string>
nullable
isStyle
required

True when the variable holds a colour, a font or another style value.

boolean
updatedAt
required
string
Example
{
"type": "string"
}

Request is invalid

Media typeapplication/json
object
message
required
string
details
required
object
key
additional properties
Examplegenerated
{
"message": "example",
"details": {
"additionalProperty": "example"
}
}

Missing or invalid api key

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Api key provides insufficient access for the request

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

Theme or variable not found

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

IfUnchangedSince no longer matches the theme

Media typeapplication/json

Body of a 409 answer when the caller’s ifUnchangedSince no longer matches.

code is always TARGET_CHANGED. Read the resource again and send the write once more.

object
message
required
string
code
required
string
Examplegenerated
{
"message": "example",
"code": "example"
}

Api key has made too many requests

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}

An unexpected error has occured. If problems persist please contact support

Media typeapplication/json
object
message
required
string
Examplegenerated
{
"message": "example"
}