Create a competition
POST/v1/competitions
POST
/v1/competitions
const url = 'https://api.ligr.live/rest/v1/competitions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","gfxName":"example","sport":"football","age":"Adults","gender":"Male","gradeId":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ligr.live/rest/v1/competitions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "gfxName": "example", "sport": "football", "age": "Adults", "gender": "Male", "gradeId": 1 }'Creates a competition. Matches inherit the default rules for the selected sport.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Competition metadata. Discover grade identifiers with GET /v1/competitions/grades.
object
name
required
Default Entity name
string
gfxName
string
sport
required
string
age
required
string
gender
required
string
gradeId
required
Entity identifier
integer format: int32
Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
Entity identifier
integer format: int32
name
required
Default Entity name
string
gfxName
required
Name predominantly display in graphics
string
sport
required
string
dataProvider
object
name
required
string
id
required
string
Example
{ "id": 24, "name": "UEFA Champions League", "gfxName": "Champions League", "sport": "football"}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 not found
Media typeapplication/json
object
message
required
string
Examplegenerated
{ "message": "example"}Api key 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"}