Update a competition
PATCH/v1/competitions/{competitionId}
const url = 'https://api.ligr.live/rest/v1/competitions/1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","gfxName":"example","shortName":"example","age":"Adults","gender":"Male","gradeId":1,"matchConfig":"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/v1/competitions/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "gfxName": "example", "shortName": "example", "age": "Adults", "gender": "Male", "gradeId": 1, "matchConfig": "example" }'Beta. This operation can change between minor versions. See Beta status.
Changes one or more fields of a competition in your organization. Send only the fields to change. Fields that you omit keep their current value. The response has the same shape as GET /v1/competitions/{competitionId}.
matchConfig applies onto the stored match rules. A key that you omit keeps its stored value.
Matches that use the competition rules get the new rules. A match that has not started rebuilds
its summary with them. Matches with their own config keep it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Entity identifier
The competition id
Request Bodyrequired
Section titled “Request Bodyrequired”Change one or more fields of a competition. Send only the fields to change. Fields that you omit keep their current value.
object
Default Entity name
Name predominantly display in graphics
A short name for tight graphics, up to 10 characters. Send null to remove it.
Entity identifier
The match rules that every match of the competition inherits. The value applies onto the stored
matchConfig: a key that you omit keeps its stored value, and a nested object merges the same way.
An array, such as periods.overtime, replaces the stored array. rules replaces the stored rules.
Send null for rules, periods.overtime, periods.shootout or dataCoverage.players to remove it.
The API checks rules and, for tennis, the scoring. A value that fails the check returns 400
with the reason, and nothing changes. Matches with their own config keep it.
Responses
Section titled “Responses”Ok
object
Entity identifier
Default Entity name
Name predominantly display in graphics
object
CDN URL of the competition logo. Present only on the competition routes.
CDN URL of the primary watermark. Present only on the competition routes.
CDN URL of the secondary watermark. Present only on the competition routes.
The match rules that every match of the competition inherits: the periods, the clock, the data
coverage and, for some sports, rules. The shape depends on the sport. A match config overrides
these values for one match. Change them with PATCH /v1/competitions/{competitionId}.
Example
{ "id": 24, "name": "UEFA Champions League", "gfxName": "Champions League", "sport": "football", "matchConfig": { "startingLineupSize": 11, "maxBenchSize": 7, "periods": { "regular": { "number": 2, "name": "Regular", "length": 45, "breakLength": 15 } }, "dataCoverage": { "stats": "minimum" } }}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 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"}