Update a trigger
PATCH/v2/game-plans/{gamePlanId}/triggers/{triggerId}
const url = 'https://api.ligr.live/rest/v2/game-plans/1/triggers/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"playlistId":1,"type":"live","group":"pregame","code":"example","period":1,"overtimeIndex":1,"triggerSeconds":1,"triggerConditions":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
Entity identifier
Request Bodyrequired
Section titled “Request Bodyrequired”Omitted fields keep their stored value. Null clears a nullable field.
playlistId names a playlist of this plan. Its scope must match type.
object
Entity identifier
A JSON object, or null.
Responses
Section titled “Responses”Ok
object
Entity identifier
The playlist the trigger runs.
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.
Extra conditions, as a JSON object. For example { "corners": { "team": 3 } }.
Example
{ "type": "live", "group": "pregame"}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"}Game plan, theme, playlist or trigger not found
object
Examplegenerated
{ "message": "example"}Organization has made too many requests
object
Examplegenerated
{ "message": "example"}An unexpected error has occured. If problems persist please contact support
object
Examplegenerated
{ "message": "example"}