Events are the top-level container for every tournament in Gestor Deportivo. An event holds the format rules, schedule boundaries, category, and media assets for a competition. Once an event exists, teams can reserve spots, matches can be scheduled, and standings can be tracked until the organizer marks it finished.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.
Event Lifecycle
Every tournament moves through a predictable sequence of states:- Create — organizer calls
POST /api/event/agregateto set up the event shell. - Teams reserve — teams submit reservation requests; the organizer accepts or rejects them.
- Run matches — games are created, goals and cards are recorded, standings are finalized.
- Finish — organizer calls
POST /api/event/finish/:eventId/event, which setsstade: falseandfinality: "Finalizado".
Classification Types
TheclassificationType boolean controls the bracket format used throughout the event:
| Value | Format |
|---|---|
false | Knockout only — single-elimination bracket with no group stage |
true | Group stage + knockout — teams are distributed into groups first, then top finishers advance |
Event Status Fields
Two fields together describe where an event stands:| Field | Type | Meaning |
|---|---|---|
stade | boolean | true = event is active and ongoing; false = event is closed |
finality | string | "En curso" while running; "Finalizado" after the finish call |
Management Endpoints
POST /api/event/agregate
Creates a new sports tournament event. The authenticated user becomes the owner. Plan-based limits apply — the number of events an account can hold is capped by subscription tier, though admin accounts bypass this check entirely. Authentication:access-token: <jwt_token> — required
Request format: multipart/form-data
Display name of the tournament (e.g.,
"Copa Primavera 2025").Full description of the event, its rules, and any relevant notes.
Player gender category. Must be one of
"Masculino", "Femenino", or "Mixto".ISO date string for when the tournament begins (e.g.,
"2025-03-01").ISO date string for when the tournament ends.
Venue or city where the event takes place.
Sport being played. Defaults to
"Futbol" if omitted.Tournament format label. One of
"Campeonato", "Copa", "Liga", or "Torneo".false for knockout-only; true for group stage + knockout.One or more banner or cover images for the event (multipart file upload, field name
eventsImg).true on success.The newly created event document.
POST /api/event/update/:eventId/event
Updates an existing event. Only the event owner can call this endpoint. All body fields are optional — only the fields you send will be updated. Images are replaced if a neweventsImg file is provided.
Authentication: access-token: <jwt_token> — required (owner only)
Request format: multipart/form-data
The
_id of the event to update.New display name for the tournament.
Updated description.
One of
"Masculino", "Femenino", or "Mixto".Updated start date string.
Updated end date string.
Updated venue or city.
Updated sport name.
Updated format label:
"Campeonato", "Copa", "Liga", or "Torneo".Updated classification format flag.
Replacement images (multipart, field name
eventsImg).true on success.The updated event document with the same shape as the create response.
POST /api/event/finish/:eventId/event
Closes an event. Setsstade to false and finality to "Finalizado". This action signals that all matches are done and the tournament has concluded. Only the event owner can call this endpoint.
Authentication: access-token: <jwt_token> — required (owner only)
The
_id of the event to finish.true on success.POST /api/event/remove/:eventId
Permanently deletes an event and its associated data. Only the event owner can delete their own events. Authentication:access-token: <jwt_token> — required (owner only)
The
_id of the event to delete.true on success.Listing Endpoints
POST /api/event/list/:owner/:pag?/:perpage?
Returns a paginated list of events. Ifowner is a user ID, only that user’s events are returned. If owner is the string "all", events from every organizer are returned.
Authentication: None required
A user
_id to filter by organizer, or the literal string "all" to retrieve events from all users.Page number (1-based). Defaults to
1 if omitted.Number of events per page. Defaults to the server-side default if omitted.
true on success.Array of event documents matching the filter.
Pagination metadata.
POST /api/event/list-public/:pag?/:perpage?
Returns a paginated list of all publicly active events — those wherestade is true. This endpoint is ideal for public-facing tournament discovery pages.
Authentication: None required
Page number (1-based).
Number of events per page.
Only events with
stade: true are returned. Finished events (stade: false) are excluded from this listing.true on success.Array of active event documents.
Pagination metadata (same shape as
/list).POST /api/event/to/:eventId/list-event
Retrieves a single event by its ID. Use this to display a tournament’s full detail page. Authentication: None requiredThe
_id of the event to retrieve.true on success.Full event document including all fields described in the Event model.