The teams and players endpoints provide public access to team and player profiles and support admin operations for creating, editing, enrolling, and soft-deleting teams and players across seasons.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta/llms.txt
Use this file to discover all available pages before exploring further.
Teams
GET /teams
Returns a paginated, searchable list of teams. Optionally scoped to a season.Return only teams that have statistics or squad registrations for this season.
Exclude teams already registered in this season. Useful when adding teams to a new season.
Case-insensitive, accent-insensitive name filter.
Page number.
Results per page.
- Request
- Response
cURL
GET /teams/:id
Returns full detail for a team, including the squad, season statistics, and match schedule. Authentication is optional — when a valid token is provided,isFollowing reflects whether the user follows this team.
Team identifier.
Season to use for squad and statistics. Defaults to the active season when omitted.
- Request
- Response
cURL
Team identifier.
Team name.
Logo URL.
Primary kit colour.
Delegate name.
Coach name.
Contact phone.
Whether the team is active (not soft-deleted).
Whether the authenticated user follows this team. Always
false for unauthenticated requests.Squad registered for the requested season, ordered by jersey number.
Season statistics for the team.
null if no stats exist for the requested season.All matches involving this team in the season, formatted the same as the match list response.
Subset of
matches filtered to status pendiente.GET /teams/:id/players
Returns the squad for a team in a specific season, ordered by jersey number.Team identifier.
Season identifier.
- Request
- Response
cURL
POST /teams/:id/toggle-follow
Toggles the follow state between the authenticated user and a team. If the user already follows the team, the call unfollows it, and vice versa. Requires authentication.Team identifier.
- Request
- Response — now following
- Response — unfollowed
cURL
Admin team endpoints
The following endpoints require the admin role.POST /teams
Creates a new team and optionally registers it for a season.Team name.
Primary kit colour.
Cloudinary logo URL.
Delegate contact name.
Head coach name.
Contact phone number.
When provided, the team is immediately registered for this season with zeroed statistics.
cURL
PUT /teams/:id
Updates an existing team. Iflogo_url changes, the old Cloudinary asset is deleted unless it shares the same public ID.
Team identifier.
Team name.
Primary kit colour.
New Cloudinary logo URL.
Delegate name.
Coach name.
Contact phone.
DELETE /teams/:id
Soft-deletes a team (setsis_active = false). The team’s history is preserved.
Team identifier.
POST /teams/:id/restore
Restores a soft-deleted team.Team identifier.
GET /teams/admin/trash
Returns all soft-deleted teams.GET /teams/admin/report
Returns all active teams for a season together with their full player rosters.Season identifier.
POST /teams/:id/register
Registers an existing team for a season by creating a zeroedteam_stats entry.
Team identifier.
Season to register the team for.
DELETE /teams/:id/season/:seasonId
Removes a team from a specific season. Deletes the team’s statistics for that season and dissociates its players from the team (players remain registered to the season).Team identifier.
Season identifier.
Players
GET /players/:id
Returns full detail for a player, including their current team and active-season statistics.Player identifier.
- Request
- Response
cURL
Player identifier.
Player name.
Date of birth (ISO 8601 date).
Player photo URL.
Whether the player is active.
Identifier of the team in the active season.
Team name in the active season.
Team logo URL in the active season.
Statistics for the active season.
null if the player has no stats record yet.Admin player endpoints
The following endpoints require the admin role unless otherwise noted.GET /players
Returns a paginated, searchable list of players. Requires admin role.Filter to players registered in this season.
Exclude players already registered in this season.
Name filter (accent-insensitive).
Page number.
Results per page.
POST /players
Creates a new player and optionally registers them to a team and season.Player name.
Date of birth (ISO 8601).
Cloudinary photo URL.
Season to register the player in.
Team to register the player with (requires
season_id).PUT /players/:id
Updates a player’s profile. Ifphoto_url changes, the old Cloudinary asset is deleted unless it shares the same public ID.
Player identifier.
Player name.
Date of birth.
New photo URL.
POST /players/:id/register
Registers or transfers a player to a team in a specific season. Any existing registration for the same season is replaced.Player identifier.
Season identifier.
Team identifier. Omit to register without a team assignment.
Jersey number. Returns a
400 if already taken in that team and season.DELETE /players/:id/unregister
Removes a player from a specific team in a specific season.Player identifier.
Team identifier.
Season identifier.
DELETE /players/:id/season/:seasonId
Removes a player from an entire season: deletes their team registration and their season statistics.Player identifier.
Season identifier.
DELETE /players/:id
Soft-deletes a player globally (is_active = false). History is preserved.
Player identifier.
POST /players/:id/restore
Restores a soft-deleted player.Player identifier.