Create a fact
POST/v2/matches/{matchId}/facts
POST
/v2/matches/{matchId}/facts
const url = 'https://api.ligr.live/rest/v2/matches/1/facts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","periodNumber":1,"teamId":1,"playerId":1,"playerTwoId":1,"date":"example","data":"example","meta":"example"}'};
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/v2/matches/1/facts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "periodNumber": 1, "teamId": 1, "playerId": 1, "playerTwoId": 1, "date": "example", "data": "example", "meta": "example" }'Create a new fact for a match. Facts record discrete match events, such as goals or cards.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”matchId
required
Entity identifier
integer format: int32
The match identifier
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
periodNumber
required
integer format: int32
teamId
integer format: int32
playerId
integer format: int32
playerTwoId
integer format: int32
date
string
data
Sport-specific detail of the event, for example the goal type or the card colour. The shape depends on the sport and the fact name.
meta
Free-form metadata that travels with the fact. LIGR stores it as sent.
Examplegenerated
{ "name": "example", "periodNumber": 1, "teamId": 1, "playerId": 1, "playerTwoId": 1, "date": "example", "data": "example", "meta": "example"}Responses
Section titled “Responses”Media typeapplication/json
object
id
required
Entity identifier
integer format: int32
matchId
required
Entity identifier
integer format: int32
name
required
string
periodNumber
required
number format: double
createdAt
required
string
Examplegenerated
{ "id": 1, "matchId": 1, "name": "example", "periodNumber": 1, "createdAt": "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"}Match or fact 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"}