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.

Every league in FutsalManager is organized around a season. A season contains groups, and groups contain teams. Fields are independent of seasons but must exist before you can schedule matches. This page walks you through the full setup flow.

Seasons

Only one season can be active at a time. When you create or update a season with is_active: true, the API automatically sets is_active = false on every other season in the same transaction.

Create a season

POST /seasons
Request body:
{
  "name": "Temporada 2025-2026",
  "start_date": "2025-09-01",
  "end_date": "2026-05-31",
  "is_active": true,
  "import_from": ""
}
FieldRequiredDescription
nameYesDisplay name for the season.
start_dateNoISO date string.
end_dateNoISO date string.
is_activeNoSet to true to make this the active season immediately.
import_fromNoID of a previous season to copy groups and player rosters from.
Pass a season ID in import_from to clone groups and player rosters atomically. This is the fastest way to start a new season with returning teams.

List all seasons

GET /seasons
Returns all seasons ordered by start_date descending.

Get the active season

GET /seasons/active
Returns a 404 if no season is currently active.

Update a season

PUT /seasons/:id
Accepts the same fields as the create request. Changing is_active to true automatically deactivates all other seasons.

Delete a season

DELETE /seasons/:id
Deleting a season fails if it still has groups or matches associated with it. Remove dependent data first.

Import structure from another season

POST /seasons/:id/import-structure
Request body:
{
  "fromSeasonId": 3
}
Copies group definitions and player rosters from the source season into the target season. Team stats are initialized to zero. Teams are not automatically assigned to groups — you do that manually after importing.

Groups

Groups are named divisions within a season (for example “Group A”, “Group B”, or “Preferente”). Each match belongs to one group, and standings are tracked per group.

Create a group

POST /groups
Request body:
{
  "name": "Grupo A",
  "season_id": 5
}
Both fields are required.

List groups

GET /groups?season_id={id}
Omit season_id to retrieve all groups across all seasons. Results include the parent season name.

Assign a team to a group

POST /groups/:id/teams
Request body:
{
  "team_id": 12,
  "season_id": 5
}
Creates a team_stats row for the team in this group and season, initializing all counters to zero. Returns a 400 if the team is already in the group.

Remove a team from a group

DELETE /groups/:id/teams/:teamId?season_id={id}
The season_id query parameter is required for precise deletion.

Fields

Fields (playing venues) are shared across all seasons. Create them once and reuse them when scheduling matches.

Create a field

POST /fields
Request body:
{
  "name": "Pabellón Municipal",
  "location": "Calle Mayor 1, Madrid"
}
name is required. location is optional but recommended.

List all fields

GET /fields
Returns fields ordered alphabetically by name.

Typical setup flow

1

Create the season

Call POST /seasons with a name, dates, and is_active: true. If you are running a second year, provide import_from with the previous season’s ID to carry over groups and rosters automatically.
POST /seasons
Content-Type: application/json

{
  "name": "Temporada 2025-2026",
  "start_date": "2025-09-01",
  "end_date": "2026-05-31",
  "is_active": true
}
2

Create groups

Call POST /groups once for each division in your season. Use the season ID returned in the previous step.
POST /groups
Content-Type: application/json

{
  "name": "Grupo A",
  "season_id": 7
}
3

Register fields

If the venues do not already exist, create them with POST /fields. Fields are reused across seasons, so skip this step if the venues from last season are still valid.
POST /fields
Content-Type: application/json

{
  "name": "Pabellón Municipal Norte",
  "location": "Av. del Deporte 10"
}
4

Enroll teams in groups

For each team that participates in the season, call POST /groups/:id/teams to assign them to their group. This creates the standings entry for the team.
POST /groups/3/teams
Content-Type: application/json

{
  "team_id": 12,
  "season_id": 7
}
Once all teams are enrolled, you are ready to schedule matches.

Build docs developers (and LLMs) love