Skip to content

Add a team player

POST/v1/teams/{teamId}/players

POST
/v1/teams/{teamId}/players
curl --request POST \
--url https://api.ligr.live/rest/v1/teams/1/players \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "firstName": "example", "lastName": "example", "number": "example", "position": "example", "positionType": "example", "gfxFirstName": "example", "gfxLastName": "example", "defaultStarter": true, "defaultBench": true }'

Creates a new player in your organization and adds the player to the roster of the team. The team must belong to your organization. The response has the same shape as an item of GET /v1/teams/{teamId}/players. Use the returned id as playerId in PUT /v2/matches/{matchId}/lineup.

teamId
required

Entity identifier

integer format: int32
>= 1

The team id

Media typeapplication/json

Add a new player to a team roster. firstName and lastName are required. number is the squad number, 0 to 3 characters. position is the position label, for example “Goalkeeper”. positionType is the sport position key, for example goalKeeper. gfxFirstName and gfxLastName are the names that graphics show, 1 to 16 characters. Set defaultStarter or defaultBench to put the player in the default starting list or on the default bench. Both are false when you omit them.

object
firstName
required

Default Player first name

string
>= 1 characters <= 35 characters
lastName
required

Default Player first name

string
>= 1 characters <= 35 characters
number
string
0 <= 3 characters
position

A player position label or position key

string
>= 1 characters <= 255 characters
positionType

A player position label or position key

string
>= 1 characters <= 255 characters
gfxFirstName

A player name that graphics show

string
>= 1 characters <= 16 characters
gfxLastName

A player name that graphics show

string
>= 1 characters <= 16 characters
defaultStarter
boolean
defaultBench
boolean
Examplegenerated
{
"firstName": "example",
"lastName": "example",
"number": "example",
"position": "example",
"positionType": "example",
"gfxFirstName": "example",
"gfxLastName": "example",
"defaultStarter": true,
"defaultBench": true
}

Created

Media typeapplication/json
object
id
required

Entity identifier

integer format: int32
>= 1
firstName
required

Default Player first name

string
>= 1 characters <= 35 characters
gfxFirstName
required

Name predominantly display in graphics

string
nullable >= 1 characters <= 19 characters
gfxLastName
required

Name predominantly display in graphics

string
nullable >= 1 characters <= 19 characters
lastName
required

Default Player first name

string
>= 1 characters <= 35 characters
position
required
string
nullable
positionType
required
string
nullable
number
required
string
0 <= 3 characters
starter
required
boolean
bench
required
boolean
captain
required
boolean
photoUrl
string
nullable /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/
Examplegenerated
{
"id": 1,
"firstName": "example",
"gfxFirstName": "example",
"gfxLastName": "example",
"lastName": "example",
"position": "example",
"positionType": "example",
"number": "example",
"starter": true,
"bench": true,
"captain": true,
"photoUrl": "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"
}

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