The Players API provides access to individual player profiles and their per-season statistics. The public detail endpoint is open to all callers; list and write operations are restricted to administrators. Registration endpoints handle assigning, transferring, and removing players from teams within a season.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danielsl4/TFG_DAM_2526/llms.txt
Use this file to discover all available pages before exploring further.
GET /players/:id — player detail
GET /players/:id — player detail
Returns a player’s profile together with their statistics for the currently active season and their current team assignment.Method:
Path:
Auth: NoneResponse —
GETPath:
/players/:idAuth: None
Path parameters
Player ID.
Response — 200 OK
Player ID.
Player full name.
Date of birth in
YYYY-MM-DD format.URL to the player’s profile photo.
ID of the team the player is registered to in the active season.
Name of that team.
Logo URL of that team.
Season statistics for the active season, or
null if the player has no stats yet.Example
Response
GET /players — list players (admin)
GET /players — list players (admin)
Returns a paginated list of all players. Requires administrator authentication. When
Path:
Auth: JWT + admin role requiredResponse —
season_id is supplied, only players registered in that season are returned and team information for that season is included.Method: GETPath:
/playersAuth: JWT + admin role required
Query parameters
Page number.
Items per page.
Case-insensitive name filter.
When present, filters to players enrolled in this season and adds
team_name, jersey_number, and team_id to each row.Response — 200 OK
Array of player objects. Fields vary slightly depending on whether
season_id is supplied.POST /players — create player (admin)
POST /players — create player (admin)
Creates a new player record. Optionally enrolls the player in a team for a given season in the same request.Method:
Path:
Auth: JWT + admin role requiredResponse —
POSTPath:
/playersAuth: JWT + admin role required
Request body
Player’s full name.
Date of birth in
YYYY-MM-DD format.URL to the player’s profile photo.
When provided, the player is enrolled in this season. Use together with
team_id to assign a team immediately.Team to enroll the player in. Only relevant when
season_id is also provided.Response — 201 Created
Confirmation message.
Full player record as stored in the database.
Example
PUT /players/:id — update player (admin)
PUT /players/:id — update player (admin)
Updates a player’s profile (name, birth date, or photo). Team assignment and statistics are managed separately via registration endpoints.Method:
Path:
Auth: JWT + admin role requiredResponse —
PUTPath:
/players/:idAuth: JWT + admin role required
Path parameters
Player ID to update.
Request body
Player name.
Date of birth (
YYYY-MM-DD).Photo URL.
Response — 200 OK
Confirmation message.
Updated player record.
Example
POST /players/:id/register — enroll player in a team (admin)
POST /players/:id/register — enroll player in a team (admin)
Assigns or transfers a player to a team for a specific season. Any existing enrollment for that player in the same season is replaced atomically. Returns
Path:
Auth: JWT + admin role requiredResponse —
400 if the requested jersey number is already taken by another player on the same team.Method: POSTPath:
/players/:id/registerAuth: JWT + admin role required
Path parameters
Player ID.
Request body
Team to assign the player to.
Season in which the enrollment applies.
Jersey number for this team and season. Must be unique within the team for the season.
Response — 200 OK
Confirmation that the player was enrolled or transferred.
Example
DELETE /players/:id/unregister — remove player from a team (admin)
DELETE /players/:id/unregister — remove player from a team (admin)
Removes a player’s enrollment from a specific team in a specific season. The player record itself is not deleted.Method:
Path:
Auth: JWT + admin role requiredResponse —
DELETEPath:
/players/:id/unregisterAuth: JWT + admin role required
Path parameters
Player ID.
Request body
Team from which the player is to be removed.
Season in which the enrollment is to be removed.
Response — 200 OK
Confirmation message.
Example
DELETE /players/:id/season/:seasonId — remove player from a season (admin)
DELETE /players/:id/season/:seasonId — remove player from a season (admin)
Removes all of a player’s enrollments and statistics for an entire season. This deletes the player’s
Path:
Auth: JWT + admin role requiredResponse —
team_players rows and player_stats rows for the given season but does not delete the player record itself.Method: DELETEPath:
/players/:id/season/:seasonIdAuth: JWT + admin role required
Path parameters
Player ID.
Season ID from which all player data should be purged.
Response — 200 OK
Confirmation message.