The seasons, groups, and fields endpoints expose the structural layer of the competition. Public callers can list seasons and groups; admin-only endpoints handle creating, editing, and deleting all three resource types.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.
Seasons
GET /seasons
Returns all seasons ordered by start date, most recent first.- Request
- Response
cURL
Season identifier.
Season name.
Start date (ISO 8601).
End date (ISO 8601).
Whether this is the currently active season. Only one season is active at a time.
GET /seasons/active
Returns the single active season.- Request
- Response
cURL
404 when no season has is_active = true.
POST /seasons
Creates a new season. Whenis_active is true, all other seasons are deactivated first. Optionally imports groups, team registrations, and squad rosters from an existing season in the same database transaction. Requires admin role.
Season name.
Start date (ISO 8601).
End date (ISO 8601).
Set to
true to mark this as the active season.ID of a season to import structure from. Copies groups, team registrations (with zeroed statistics), and player squad entries into the new season.
- Request
- Response
cURL
PUT /seasons/:id
Updates an existing season. Whenis_active is set to true, all other seasons are deactivated. Requires admin role.
Season identifier.
Season name.
Start date (ISO 8601).
End date (ISO 8601).
Whether to make this the active season.
cURL
DELETE /seasons/:id
Permanently deletes a season. Fails if the season has dependant records (groups, matches) due to database foreign-key constraints. Requires admin role.Season identifier.
cURL
POST /seasons/:id/import-structure
Copies the group structure, team registrations (with zeroed stats), and player squad entries from another season into an existing season. Runs in a single database transaction. Requires admin role.The target season that will receive the imported data.
The source season to copy from.
- Request
- Response
cURL
Confirmation message.
Number of groups copied from the source season.
Groups
GET /groups
Returns all groups, optionally filtered by season. Results are ordered by season start date (newest first) and then group name alphabetically.Filter to groups belonging to this season.
- Request
- Response
cURL
Group identifier.
Group name.
Season this group belongs to.
Season name.
GET /groups/:id/teams
Returns the teams assigned to a group, ordered by points then goals scored.Group identifier.
cURL
id, name, logo_url, played, and points.
Admin group endpoints
The following endpoints require the admin role.POST /groups
Creates a new group in a season.Group name.
Season to create the group in.
cURL
201 Created.
PUT /groups/:id
Updates a group’s name or season assignment.Group identifier.
New group name.
New season assignment.
DELETE /groups/:id
Permanently deletes a group. Fails if the group has associated matches.Group identifier.
POST /groups/:id/teams
Assigns a team to a group by creating ateam_stats entry for the given team, group, and season.
Group identifier.
Team identifier.
Season identifier.
DELETE /groups/:id/teams/:teamId
Removes a team from a group by deleting the correspondingteam_stats row.
Group identifier.
Team identifier.
Season identifier (required query parameter).
Fields
GET /fields
Returns all active playing fields ordered by name.- Request
- Response
cURL
Field identifier.
Field name.
Physical address or location description.
Always
true in this response — inactive fields are excluded.Admin field endpoints
The following endpoints require the admin role.POST /fields
Creates a new field.Field name.
Physical address or location description.
cURL
201 Created.
PUT /fields/:id
Updates a field’s name or location.Field identifier.
Field name.
Location description.
DELETE /fields/:id
Soft-deletes a field (setsis_active = false).
Field identifier.
POST /fields/:id/restore
Restores a soft-deleted field.Field identifier.
DELETE /fields/:id/permanent
Permanently deletes a field. The field must already be in the trash (is_active = false). Returns 400 if the field has associated matches.
Field identifier.
GET /fields/admin/trash
Returns all soft-deleted fields, ordered by name.cURL