Set a highlight rule
PUT/v2/competitions/{competitionId}/highlight-rules/{factName}
const url = 'https://api.ligr.live/rest/v2/competitions/1/highlight-rules/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"lead":1,"lag":1,"conditions":{"tag":"example","teamId":1,"clubId":1,"homeTeam":true,"awayTeam":true,"subEvent":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.ligr.live/rest/v2/competitions/1/highlight-rules/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "lead": 1, "lag": 1, "conditions": { "tag": "example", "teamId": 1, "clubId": 1, "homeTeam": true, "awayTeam": true, "subEvent": "example" } }'Beta. This operation can change between minor versions. See Beta status.
Creates the rule for one event, or replaces it. factName is a fact of the competition’s
sport, for example GOAL, or MOMENT for manual moments. The body replaces lead, lag
and conditions: a field you leave out goes back to its default. Settings that only the
dashboard edits, such as auto-posting, keep their value. Sending the same body again changes
nothing.
The dashboard can save two rules for one event. This route then answers 409 with the code
HIGHLIGHT_RULE_AMBIGUOUS and changes nothing. Change those rules in the dashboard.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
The event, for example GOAL or MOMENT
Request Bodyrequired
Section titled “Request Bodyrequired”The fields of a highlight rule that REST sets. The request replaces all three: a field you leave out or send as null goes back to its default.
object
Seconds of video before the fact. Null or left out: 10.
Seconds of video after the fact. Null or left out: 20.
Null or left out: every fact of the event makes a clip.
object
MOMENT rules only. The name of a tag of your organization. The rule clips moments that carry it.
Clip only facts of this team.
Clip only facts of a team of this club.
POINT_SCORED rules only. Clip only points of the home team.
POINT_SCORED rules only. Clip only points of the away team.
Clip only facts whose data sets this key, for example a tennis ace on POINT_SCORED.
Examplegenerated
{ "lead": 1, "lag": 1, "conditions": { "tag": "example", "teamId": 1, "clubId": 1, "homeTeam": true, "awayTeam": true, "subEvent": "example" }}Responses
Section titled “Responses”Ok
One highlight rule. When a fact of event factName lands in a match of the competition, and
the match has a stream with generateHighlights on, LIGR cuts a clip.
object
The event, for example GOAL, or MOMENT for a manual moment.
Seconds before the fact. Null: 10.
Seconds after the fact. Null: 20.
object
MOMENT rules only. The name of a tag of your organization. The rule clips moments that carry it.
Clip only facts of this team.
Clip only facts of a team of this club.
POINT_SCORED rules only. Clip only points of the home team.
POINT_SCORED rules only. Clip only points of the away team.
Clip only facts whose data sets this key, for example a tennis ace on POINT_SCORED.
Examplegenerated
{ "factName": "example", "lead": 1, "lag": 1, "conditions": { "tag": "example", "teamId": 1, "clubId": 1, "homeTeam": true, "awayTeam": true, "subEvent": "example" }}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"}Competition or highlight rule not found
object
Examplegenerated
{ "message": "example"}The competition has two or more rules for the event
object
HIGHLIGHT_RULE_AMBIGUOUS
Examplegenerated
{ "message": "example", "code": "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"}