Skip to content

Update a trigger

PATCH/v2/game-plans/{gamePlanId}/triggers/{triggerId}

PATCH
/v2/game-plans/{gamePlanId}/triggers/{triggerId}
curl --request PATCH \
--url https://api.ligr.live/rest/v2/game-plans/1/triggers/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "playlistId": 1, "type": "live", "group": "pregame", "code": "example", "period": 1, "overtimeIndex": 1, "triggerSeconds": 1, "triggerConditions": "example" }'

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

Updates a trigger of a game plan. Omitted fields keep their stored value. Null clears a nullable field.

The update stores the trigger as a new row. The response carries the new id, and the old id stops working. Use the returned id for the next update.

gamePlanId
required

Entity identifier

integer format: int32
>= 1
triggerId
required

Entity identifier

integer format: int32
>= 1
Media typeapplication/json

Omitted fields keep their stored value. Null clears a nullable field. playlistId names a playlist of this plan. Its scope must match type.

object
playlistId

Entity identifier

integer format: int32
>= 1
type
string
Allowed values: live break
group
string
Allowed values: pregame regular overtime shootout postgame live
code
string
nullable
period
integer format: int32
overtimeIndex
integer format: int32
triggerSeconds
integer format: int32
triggerConditions

A JSON object, or null.

Ok

Media typeapplication/json
object
id
required

Entity identifier

integer format: int32
>= 1
playlistId
required

The playlist the trigger runs.

integer format: int32
>= 1
type
required
string
Allowed values: live break
group
required
string
Allowed values: pregame regular overtime shootout postgame live
code
required

The event that fires the trigger. A live trigger uses a fact code such as GOAL or YELLOW_CARD. A break trigger uses a break code such as aboutToStart, playersEntering or timeTrigger.

string
nullable
period
required
integer format: int32
nullable
overtimeIndex
required
integer format: int32
nullable
triggerSeconds
required
integer format: int32
nullable
triggerConditions
required

Extra conditions, as a JSON object. For example { "corners": { "team": 3 } }.

Example
{
"type": "live",
"group": "pregame"
}

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"
}

Game plan, theme, playlist or trigger not found

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

Organization 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"
}