The Teams API provides public access to team listings and detailed profiles — including squad rosters, season statistics, and upcoming matches. Authenticated users can follow or unfollow any team. Administrators have full CRUD capabilities: creating teams, editing metadata, soft-deleting to a trash bin with restore support, registering existing teams in new seasons, and generating a detailed report of all teams and players for a given 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.
Public endpoints
List teams
GET /teams
Returns a paginated list of active teams. Filter by season to show only teams that participated in that season (have stats or players registered). Supports fuzzy, accent-insensitive name search.
When provided, returns only teams with stats or registered players in that season.
Exclude teams already registered in this season. Useful when assigning new teams to a season.
Page number (1-indexed).
Results per page.
Accent-insensitive substring search on team name.
Array of team summary objects.
Get team detail
GET /teams/:id
Returns the full team profile: basic info, season stats, full squad with per-player goal tallies, upcoming matches, and all matches for the season. Optionally filters data by season. When an authenticated user’s token is provided, the response also includes the isFollowing flag.
Team ID.
Season to use when fetching players, stats, and matches. Defaults to the active season.
| Status | Meaning |
|---|---|
404 | Team not found. |
List players for a team in a season
GET /teams/:id/players
Returns the squad registered for a specific team in a given season, ordered by jersey number.
Team ID.
Season ID. This parameter is required.
| Status | Meaning |
|---|---|
400 | season_id not provided. |
Follow / unfollow a team
POST /teams/:id/toggle-follow
Toggles the follow relationship between the authenticated user and the team. If the user already follows the team, the endpoint unfollows. Authentication is required.
Team ID.
Admin endpoints
Create team
POST /teams
Creates a new team. Optionally registers the team in a season immediately by passing season_id.
Team name. Must be unique and non-empty.
Primary kit colour.
Cloudinary image URL for the team logo.
Delegate contact name.
Head coach name.
Contact phone number.
If provided, the team is registered in this season immediately after creation.
Update team
PUT /teams/:id
Updates team metadata. When logo_url changes and the public IDs differ, the previous image is deleted from Cloudinary automatically.
Team ID.
Team name.
Kit colour.
New logo URL.
Delegate name.
Coach name.
Phone number.
Soft-delete team
DELETE /teams/:id
Moves the team to the trash (is_active = false). The team no longer appears in public listings but retains all historical data.
Team ID.
Restore team from trash
POST /teams/:id/restore
Restores a soft-deleted team.
Team ID.
List trashed teams
GET /teams/admin/trash
Returns all teams with is_active = false, ordered alphabetically.
Register team in a season
POST /teams/:id/register
Registers an existing team in a season by creating a team_stats record. Any existing record for the same team/season combination is replaced to avoid duplicates.
Team ID.
Season to register the team in.
Remove team from a season
DELETE /teams/:id/season/:seasonId
Removes a team from a specific season. Deletes the team’s stats for that season and unlinks all players (players retain their records but are no longer assigned to the team for that season).
Team ID.
Season ID.
Teams and players report
GET /teams/admin/report
Returns a list of all teams active in a season, each with their registered players. Intended for generating official squad sheets.
Season ID. Required — returns
400 if omitted.players array: