The Seasons API governs the full lifecycle of a competition season, from initial creation through to deletion. Public endpoints let any client list seasons or resolve the currently active one. Admin endpoints allow creating, editing, and deleting seasons, along with a structure import feature that clones groups, team registrations, and player squads from an existing season — saving significant setup time at the start of a new campaign.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
These routes do not require authentication and are safe to call from the frontend without a token.GET /seasons
Returns all seasons ordered bystart_date descending.
Response — array
Unique season identifier.
Season name (e.g.
"2025/26").ISO 8601 start date.
ISO 8601 end date.
Whether this is the currently active season.
cURL
Example response
GET /seasons/active
Returns the single season currently marked as active. Useful for defaulting the UI to the current competition without requiring the caller to filter the full list. Responses| Status | Description |
|---|---|
200 | Active season object |
404 | No season is currently marked active |
cURL
Admin endpoints
All routes below requireAuthorization: Bearer <token> with role: "admin" in the JWT payload.
POST /seasons
Creates a new season. Whenimport_from is provided, the server atomically clones groups, team stats (reset to zero), and player-team assignments from the source season within a single database transaction. If any part of the import fails the entire operation rolls back and no records are created.
Request body
Human-readable season name (e.g.
"2026/27").ISO 8601 date the season begins.
ISO 8601 date the season ends.
Set to
true to make this the active season. All other seasons will be automatically deactivated within the same transaction.ID of an existing season to clone structure from. When provided, groups, team stats (zeroed), and player-team assignments are copied atomically.
201 Created
Returns the newly created season object.
cURL
Example response
PUT /seasons/:id
Updates the fields of an existing season. Settingis_active: true automatically sets all other seasons to is_active = false before the update is applied, guaranteeing at most one active season at any time.
Path parameters
ID of the season to update.
New season name.
New start date (ISO 8601).
New end date (ISO 8601).
When
true, deactivates all other seasons before marking this one active.cURL
DELETE /seasons/:id
Permanently deletes a season record from the database. Path parametersID of the season to delete.
Confirmation of deletion.
cURL
POST /seasons/:id/import-structure
Clones the structure of another season into an existing target season. The operation copies groups (by name), initializes team stats at zero for each team from the source season, and re-enrolls players with their jersey numbers — all within a single atomic transaction. This endpoint is useful when a season already exists and you want to pull structure from a different source season after creation, as opposed to using theimport_from field on POST /seasons.
Path parameters
ID of the target season that will receive the imported structure.
ID of the source season to clone groups, team stats, and player squads from.
Confirmation message noting that groups and player squads have been imported and teams are ready to be assigned to groups.
Number of groups copied from the source season.
cURL
Example response
Group management
Groups represent competition divisions within a season (e.g. “Group A”, “Group B”). The list endpoint is public; create, update, and delete require an admin JWT.GET /groups
Returns all groups, each joined with its parent season name. Ordered by season start date descending, then group name ascending. Query parametersFilter results to groups belonging to a specific season.
array
Group ID.
Group name.
ID of the parent season.
Name of the parent season (joined).
cURL
POST /groups
Creates a new group within a season. Bothname and season_id are required.
Request body
Display name for the group (e.g.
"Group A").ID of the season this group belongs to.
201 Created. Returns the new group object.
cURL
PUT /groups/:id
Updates the name (and optionally the parent season) of an existing group. Path parametersID of the group to update.
New group name.
Reassign to a different season.
cURL
DELETE /groups/:id
Permanently deletes a group. The operation will fail if the group has associated matches. Path parametersID of the group to delete.
Confirmation of deletion.
cURL