Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/gestor-backend/llms.txt

Use this file to discover all available pages before exploring further.

Gestor Deportivo lets you organize complete sporting competitions — from a single-elimination cup to a full league season — all through the API. You create an event, teams reserve spots, you confirm their participation, schedule matches, and then track live standings right through to the final whistle.

Tournament setup and execution

1

Create an event

An event is the top-level container for any competition. Provide the dates, format, category, and sport. You can optionally attach a cover image via multipart/form-data.
curl -X POST https://api.example.com/api/event/agregate \
  -H "Authorization: Bearer <token>" \
  -F "title=Copa Primavera 2025" \
  -F "description=Regional youth football cup open to all clubs in the metropolitan area" \
  -F "startDate=2025-03-01" \
  -F "endDate=2025-04-15" \
  -F "category=Masculino" \
  -F "ubication=Estadio Municipal, Guatemala City" \
  -F "sport=Football" \
  -F "keys=Copa" \
  -F "classificationType=false" \
  -F "eventsImg=@/path/to/cover.png"
FieldTypeDescription
titlestringDisplay name for the competition
descriptionstringBrief overview visible to the public
startDate / endDatedate stringCompetition window
categorystringMasculino, Femenino, or Mixto
ubicationstringVenue or city
sportstringSport being played
keysstringCompetition type — see event types below
classificationTypebooleanfalse = knockout only, true = group stage + knockout
The response includes the new event’s _id, used in all subsequent steps.
2

Teams reserve spots

Teams apply to participate by submitting a reservation. A team owner sends this request; no organizer action is needed at this point.
curl -X POST https://api.example.com/api/reserve/agregate/<eventId>/<teamId>/reserve \
  -H "Authorization: Bearer <token>"
The reservation is created with a status of Pendiente (pending) until the organizer reviews it.
3

Organizer accepts reservations

Review incoming reservation requests and accept or reject each one. Accepting a reservation confirms that team’s spot in the competition.
# Accept (or update) a reservation
curl -X POST https://api.example.com/api/reserve/activate/<reserveId> \
  -H "Authorization: Bearer <token>"
To review all pending reservations before acting on them:
curl -X POST https://api.example.com/api/reserve/list/Pendiente/reserves/1/20 \
  -H "Authorization: Bearer <token>"
Replace Pendiente with Aceptado, Rechazado, or Cancelado to filter by other statuses.
4

Schedule matches

Once teams are confirmed, create individual match fixtures. Each match is tied to the event and includes venue, date, time, and referee information.
curl -X POST https://api.example.com/api/game/new-matches/<eventId>/game \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "teams": ["<teamAId>", "<teamBId>"],
    "matchDate": "2025-03-08",
    "matchTime": "15:00",
    "matchDay": 1,
    "scenery": "Estadio Municipal — Cancha 2",
    "workingday": "Jornada 1",
    "refereeName": "Luis García"
  }'
Repeat this for every fixture in your tournament. See the Match Management guide for how to record goals, cards, and final results once matches are played.
5

Record match results

On match day, use the match management endpoints to record goals, disciplinary cards, fouls, and substitutions in real time or after the fact. Full instructions are covered in the Match Management guide.
6

View the standings table

The standings table is updated each time a match is finalized. Anyone can query it without authentication.
curl -X POST https://api.example.com/api/game/list/<eventId>/table/game
The response lists each team’s points, wins, draws, losses, goals for/against, and goal difference. For individual scoring stats, use the top-scorer endpoint:
curl -X POST https://api.example.com/api/game/list/<eventId>/table-gols
7

Finish the event

Mark the event as finished once all matches have been played. This transitions the event’s stade from true (active) to false (finished) and sets finality to reflect completion.
curl -X POST https://api.example.com/api/event/finish/<eventId>/event \
  -H "Authorization: Bearer <token>"

Event types (keys)

The keys field defines the type of competition. Choose the format that best matches your tournament structure.

Campeonato

A full championship — typically the highest-stakes competition in a league system, often involving multiple stages.

Copa

A cup competition, usually single-elimination or with a group stage feeding into a knockout bracket.

Liga

A league format where every team plays a set number of fixtures and points are accumulated over time.

Torneo

A general-purpose tournament format suitable for shorter, one-off competitions or invitational events.

Tournament formats (classificationType)

The classificationType boolean controls how the competition is structured internally.
Setting classificationType to false creates a pure knockout tournament — teams are eliminated after a single loss and there are no group-stage standings to maintain. Setting it to true enables a group stage followed by a knockout phase, which is common in larger competitions like the Copa format. Make sure your match-scheduling logic accounts for both phases when using group stage mode.

Reservation status flow

A reservation moves through the following lifecycle. Only the organizer can transition from Pendiente to Aceptado or Rechazado. A team owner can cancel their own reservation at any time.
Pendiente → Aceptado
          → Rechazado
          → Cancelado  (cancelled by the team)
To cancel a reservation:
curl -X POST https://api.example.com/api/reserve/remove/<eventId>/reserve \
  -H "Authorization: Bearer <token>"
To list accepted reservations for an event:
curl -X POST https://api.example.com/api/reserve/list/<eventId>/reserve-accepts/1/20 \
  -H "Authorization: Bearer <token>"

Browsing public events

Active events are visible to anyone — no authentication required. Use this endpoint to display upcoming competitions in a public-facing app or website.
# List all active public events (page 1, 10 per page)
curl -X POST https://api.example.com/api/event/list-public/1/10

# Get a specific event by ID
curl -X POST https://api.example.com/api/event/to/<eventId>/list-event
To list events filtered by organizer, pass the owner’s user ID (or all to retrieve every event):
curl -X POST https://api.example.com/api/event/list/<ownerId>/1/20 \
  -H "Authorization: Bearer <token>"

Build docs developers (and LLMs) love