Skip to main content

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.

A competition in Futsal League Manager is structured around two building blocks: groups (the competitive divisions within a season) and fields (the physical venues where matches are played). Together they give you full control over how teams are organised and where fixtures take place.

Groups

What a group is

A group belongs to a single season and contains a set of teams. Every match in the group stage references a group_id, and standings (points, wins, draws, losses, goals) are calculated per group. A season can have any number of groups — for example, Group A, Group B, and Group C for a large season, or a single Liga group for a smaller one.

Creating a group

POST /groups
Request body:
{
  "name": "Group A",
  "season_id": 5
}
Both name and season_id are required. The group is created immediately and logged in the audit trail. You can then assign teams to it.

Listing groups

GET /groups
GET /groups?season_id=5
Without a season_id query parameter the endpoint returns all groups across all seasons, ordered by season start date (newest first) and then alphabetically by group name. Pass season_id to filter to a specific season.

Editing and deleting a group

  • Edit (PUT /groups/:id): Update the name or reassign the group to a different season.
  • Delete (DELETE /groups/:id): Permanently removes the group. The deletion fails if the group has associated matches — remove or reassign matches first.
Deleting a group with active fixtures is blocked by a database constraint. The API returns a descriptive error message when this occurs. Reassign or delete the associated matches before removing the group.

Assigning teams to a group

When you assign a team to a group, the system creates (or updates) a team_stats record linking the team, group, and season:
POST /groups/:id/teams
Request body:
{
  "team_id": 12,
  "season_id": 5
}
Both fields are required. If the team is already in this group and season, the API returns a 400 error to prevent duplicates. The team’s standings within the group start at zero and update automatically as match results are recorded. To see which teams are currently in a group, along with their points and games played:
GET /groups/:id/teams
Teams are returned ordered by points descending, then goals scored descending, then alphabetically.

Removing a team from a group

DELETE /groups/:id/teams/:teamId?season_id=5
The season_id query parameter is required to identify the exact team_stats record to remove. This operation removes the team’s standings from the group but does not delete the team itself or its enrollment in the season.

Competition phases

Matches carry a fase (phase) field that controls which stage of the competition they belong to. The supported phases are:
Phase valueStage
fase_de_gruposGroup stage
octavosRound of 16
cuartosQuarter-finals
semisSemi-finals
finalFinal
Group-stage matches reference a group_id. Knockout-phase matches (octavos through final) may reference placeholder names for teams that have not yet qualified (stored in home_team_placeholder and away_team_placeholder on the match record) instead of a direct team ID.

Playing fields

What a field is

A field is a physical venue where matches are played. Each field has a name and a location. When you schedule a fixture you optionally assign it to a field — the field name and location then appear on the match detail page and in team schedules.

Managing fields

Create a field:
POST /fields
{
  "name": "Pabellón Municipal Norte",
  "location": "Carrer de l'Esport, 12, Barcelona"
}
Only name is required. location is a free-text string for the address or description. Edit a field (PUT /fields/:id): Update the name or location. Soft delete a field (DELETE /fields/:id): Sets is_active = false. The field is hidden from the field picker when scheduling matches but its name still appears on historical fixtures. Retrieve deleted fields from GET /fields/admin/trash and restore them with POST /fields/:id/restore. Permanently delete a field (DELETE /fields/:id/permanent): Only available for fields that are already in the trash. The operation is blocked if any match references the field — the API returns a 400 error in that case.
Fields use a two-stage delete to protect match history. Move a field to the trash first, then permanently delete it only if no fixtures reference it.

How fields relate to matches

When you create or update a match you can set field_id to associate it with a venue. The field’s name and location are then included in every API response that returns match data, giving users full venue information alongside the fixture details.

Build docs developers (and LLMs) love