Skip to main content

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.

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.
Returns a player’s profile together with their statistics for the currently active season and their current team assignment.Method: GET
Path: /players/:id
Auth: None

Path parameters

id
number
required
Player ID.

Response — 200 OK

id
number
Player ID.
name
string
Player full name.
birth_date
string
Date of birth in YYYY-MM-DD format.
photo_url
string
URL to the player’s profile photo.
team_id
number | null
ID of the team the player is registered to in the active season.
team_name
string | null
Name of that team.
Logo URL of that team.
stats
object | null
Season statistics for the active season, or null if the player has no stats yet.

Example

curl "https://api.futsalmanager.example/players/42"
Response
{
  "id": 42,
  "name": "Marcos Ruiz",
  "birth_date": "1998-03-15",
  "photo_url": "https://res.cloudinary.com/example/image/upload/players/marcos.jpg",
  "team_id": 7,
  "team_name": "Atlético Norte",
  "team_logo": "https://res.cloudinary.com/example/image/upload/teams/atletico.png",
  "stats": {
    "goals": 12,
    "yellow_cards": 3,
    "red_cards": 0,
    "matches_played": 18
  }
}
Returns a paginated list of all players. Requires administrator authentication. When season_id is supplied, only players registered in that season are returned and team information for that season is included.Method: GET
Path: /players
Auth: JWT + admin role required

Query parameters

page
number
default:"1"
Page number.
limit
number
default:"10"
Items per page.
Case-insensitive name filter.
season_id
number
When present, filters to players enrolled in this season and adds team_name, jersey_number, and team_id to each row.

Response — 200 OK

players
object[]
Array of player objects. Fields vary slightly depending on whether season_id is supplied.
pagination
object
Creates a new player record. Optionally enrolls the player in a team for a given season in the same request.Method: POST
Path: /players
Auth: JWT + admin role required

Request body

name
string
required
Player’s full name.
birth_date
string
Date of birth in YYYY-MM-DD format.
photo_url
string
URL to the player’s profile photo.
season_id
number
When provided, the player is enrolled in this season. Use together with team_id to assign a team immediately.
team_id
number
Team to enroll the player in. Only relevant when season_id is also provided.

Response — 201 Created

message
string
Confirmation message.
player
object
Full player record as stored in the database.

Example

curl -X POST "https://api.futsalmanager.example/players" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Marcos Ruiz", "birth_date": "1998-03-15", "season_id": 3, "team_id": 7}'
Updates a player’s profile (name, birth date, or photo). Team assignment and statistics are managed separately via registration endpoints.Method: PUT
Path: /players/:id
Auth: JWT + admin role required

Path parameters

id
number
required
Player ID to update.

Request body

name
string
Player name.
birth_date
string
Date of birth (YYYY-MM-DD).
photo_url
string
Photo URL.

Response — 200 OK

message
string
Confirmation message.
player
object
Updated player record.

Example

curl -X PUT "https://api.futsalmanager.example/players/42" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Marcos Ruiz", "birth_date": "1998-03-15", "photo_url": "https://cdn.example/players/42.jpg"}'
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 400 if the requested jersey number is already taken by another player on the same team.Method: POST
Path: /players/:id/register
Auth: JWT + admin role required

Path parameters

id
number
required
Player ID.

Request body

team_id
number
required
Team to assign the player to.
season_id
number
required
Season in which the enrollment applies.
jersey_number
string
Jersey number for this team and season. Must be unique within the team for the season.

Response — 200 OK

message
string
Confirmation that the player was enrolled or transferred.

Example

curl -X POST "https://api.futsalmanager.example/players/42/register" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"team_id": 7, "season_id": 3, "jersey_number": "10"}'
Removes a player’s enrollment from a specific team in a specific season. The player record itself is not deleted.Method: DELETE
Path: /players/:id/unregister
Auth: JWT + admin role required

Path parameters

id
number
required
Player ID.

Request body

team_id
number
required
Team from which the player is to be removed.
season_id
number
required
Season in which the enrollment is to be removed.

Response — 200 OK

message
string
Confirmation message.

Example

curl -X DELETE "https://api.futsalmanager.example/players/42/unregister" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"team_id": 7, "season_id": 3}'
Removes all of a player’s enrollments and statistics for an entire season. This deletes the player’s team_players rows and player_stats rows for the given season but does not delete the player record itself.Method: DELETE
Path: /players/:id/season/:seasonId
Auth: JWT + admin role required

Path parameters

id
number
required
Player ID.
seasonId
number
required
Season ID from which all player data should be purged.

Response — 200 OK

message
string
Confirmation message.

Example

curl -X DELETE "https://api.futsalmanager.example/players/42/season/3" \
  -H "Authorization: Bearer <token>"

Build docs developers (and LLMs) love