Skip to content

Set a highlight rule

PUT/v2/competitions/{competitionId}/highlight-rules/{factName}

PUT
/v2/competitions/{competitionId}/highlight-rules/{factName}
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.

competitionId
required

Entity identifier

integer format: int32
>= 1
factName
required
string

The event, for example GOAL or MOMENT

Media typeapplication/json

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
lead

Seconds of video before the fact. Null or left out: 10.

integer format: int32
<= 720
lag

Seconds of video after the fact. Null or left out: 20.

integer format: int32
<= 720
conditions

Null or left out: every fact of the event makes a clip.

object
tag

MOMENT rules only. The name of a tag of your organization. The rule clips moments that carry it.

string
teamId

Clip only facts of this team.

integer format: int32
clubId

Clip only facts of a team of this club.

integer format: int32
homeTeam

POINT_SCORED rules only. Clip only points of the home team.

boolean
awayTeam

POINT_SCORED rules only. Clip only points of the away team.

boolean
subEvent

Clip only facts whose data sets this key, for example a tennis ace on POINT_SCORED.

string
Examplegenerated
{
"lead": 1,
"lag": 1,
"conditions": {
"tag": "example",
"teamId": 1,
"clubId": 1,
"homeTeam": true,
"awayTeam": true,
"subEvent": "example"
}
}

Ok

Media typeapplication/json

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
factName
required

The event, for example GOAL, or MOMENT for a manual moment.

string
lead
required

Seconds before the fact. Null: 10.

number format: double
nullable
lag
required

Seconds after the fact. Null: 20.

number format: double
nullable
conditions
required
object
tag

MOMENT rules only. The name of a tag of your organization. The rule clips moments that carry it.

string
teamId

Clip only facts of this team.

integer format: int32
clubId

Clip only facts of a team of this club.

integer format: int32
homeTeam

POINT_SCORED rules only. Clip only points of the home team.

boolean
awayTeam

POINT_SCORED rules only. Clip only points of the away team.

boolean
subEvent

Clip only facts whose data sets this key, for example a tennis ace on POINT_SCORED.

string
Examplegenerated
{
"factName": "example",
"lead": 1,
"lag": 1,
"conditions": {
"tag": "example",
"teamId": 1,
"clubId": 1,
"homeTeam": true,
"awayTeam": true,
"subEvent": "example"
}
}

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

Competition or highlight rule not found

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

The competition has two or more rules for the event

Media typeapplication/json
object
message
required
string
code
required

HIGHLIGHT_RULE_AMBIGUOUS

string
Examplegenerated
{
"message": "example",
"code": "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"
}