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 uses a reservation system to manage how teams join tournaments and how players join teams. There are two distinct reservation flows: event reservations, where a team requests a spot in a tournament, and team membership reservations, where a player requests to join a team. Each type has its own set of endpoints and status lifecycle.

Reservation Status Flow

Both reservation types share the same status enum, moving from a pending state to a terminal outcome:
StatusMeaning
"Pendiente"Request submitted, awaiting review
"Aceptado"Request approved — the team or player is admitted
"Rechazado"Request denied by the organizer or team
"Cancelado"Request withdrawn or cancelled
New reservations always start with statusType: "Pendiente". Only the relevant owner (event organizer for event reservations, team manager for membership reservations) can change the status.

Event Reservations

Event reservations allow a team to request a spot in a tournament. The event organizer reviews pending requests and accepts, rejects, or cancels them.

POST /api/reserve/agregate/:eventId/:teamId/reserve

Creates a new reservation request for a team to participate in an event. The reservation is created with statusType: "Pendiente" and must be approved by the event organizer before the team can be added to the bracket. Authentication: access-token: <jwt_token> — required
eventId
string
required
The _id of the event the team wants to join.
teamId
string
required
The _id of the team making the reservation request.
curl -X POST https://api.example.com/api/reserve/agregate/64a1f2c3e4b5d6f7a8b9c0d1/64b2e3d4f5a6b7c8d9e0f1a2/reserve \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
reserve
object
The newly created reservation document.
{
  "status": true,
  "reserve": {
    "_id": "64f5a6b7c8d9e0f1a2b3c4d5",
    "event": "64a1f2c3e4b5d6f7a8b9c0d1",
    "team": "64b2e3d4f5a6b7c8d9e0f1a2",
    "statusType": "Pendiente"
  }
}

POST /api/reserve/activate/:reserveId

Updates the status of an event reservation. Only the event organizer can call this endpoint. Use this to accept, reject, or cancel a team’s reservation request. Authentication: access-token: <jwt_token> — required (event owner only)
reserveId
string
required
The _id of the reservation to update.
statusType
string
required
The new status. Must be one of "Pendiente", "Aceptado", "Rechazado", or "Cancelado".
Setting statusType to "Aceptado" admits the team into the tournament. This action should be taken only after verifying the team meets any eligibility requirements for the event.
curl -X POST https://api.example.com/api/reserve/activate/64f5a6b7c8d9e0f1a2b3c4d5 \
  -H "access-token: <jwt_token>" \
  -H "Content-Type: application/json" \
  -d '{ "statusType": "Aceptado" }'
status
boolean
true on success.
{ "status": true }

POST /api/reserve/list/:eventId/reserve-accepts/:pag?/:perpage?

Returns a paginated list of accepted reservations for a specific event — teams that have been admitted into the tournament. Authentication: access-token: <jwt_token> — required
eventId
string
required
The _id of the event.
pag
number
Page number (1-based). Defaults to 1.
perpage
number
Items per page.
curl -X POST https://api.example.com/api/reserve/list/64a1f2c3e4b5d6f7a8b9c0d1/reserve-accepts/1/10 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of accepted reservation documents for the event.
pagination
object
Pagination metadata.
{
  "status": true,
  "data": [
    {
      "_id": "64f5a6b7c8d9e0f1a2b3c4d5",
      "team": "64b2e3d4f5a6b7c8d9e0f1a2",
      "statusType": "Aceptado"
    }
  ],
  "pagination": {
    "total": 12,
    "page": 1,
    "perpage": 10,
    "pages": 2
  }
}

POST /api/reserve/list/:typeStatus/reserves/:pag?/:perpage?

Returns a paginated list of reservations filtered by their status. Useful for an organizer’s dashboard to review all pending, accepted, rejected, or cancelled requests at once. Authentication: access-token: <jwt_token> — required
typeStatus
string
required
Status filter. Must be one of "Pendiente", "Aceptado", "Rechazado", or "Cancelado".
pag
number
Page number (1-based).
perpage
number
Items per page.
# List all pending reservations
curl -X POST https://api.example.com/api/reserve/list/Pendiente/reserves/1/20 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of reservation documents matching the given typeStatus.
pagination
object
Pagination metadata (same shape as the accepted-list endpoint).
{
  "status": true,
  "data": [
    {
      "_id": "64f5a6b7c8d9e0f1a2b3c4d6",
      "event": "64a1f2c3e4b5d6f7a8b9c0d1",
      "team": "64b2e3d4f5a6b7c8d9e0f1a3",
      "statusType": "Pendiente"
    }
  ],
  "pagination": {
    "total": 3,
    "page": 1,
    "perpage": 20,
    "pages": 1
  }
}

POST /api/reserve/remove/:eventId/reserve

Removes a reservation associated with an event. Use this to delete a reservation record entirely, as opposed to simply changing its status. Authentication: access-token: <jwt_token> — required
eventId
string
required
The _id of the event whose reservation to remove.
curl -X POST https://api.example.com/api/reserve/remove/64a1f2c3e4b5d6f7a8b9c0d1/reserve \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
{ "status": true }

Team Membership Reservations

Team membership reservations handle the player-to-team joining process. A player submits a request to join a team, and the team manager reviews and activates (approves) it. Both parties can query their respective views of outstanding requests.

POST /api/reserve-accepts-team/create/:playerId/:teamId

Creates a join request from a player to a team. The request starts in a pending state and must be activated by the team before the player is added to the team roster. Authentication: access-token: <jwt_token> — required
playerId
string
required
The _id of the player requesting to join.
teamId
string
required
The _id of the team the player wants to join.
curl -X POST https://api.example.com/api/reserve-accepts-team/create/64e5f6a7b8c9d0e1f2a3b4c5/64b2e3d4f5a6b7c8d9e0f1a2 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
{ "status": true }

POST /api/reserve-accepts-team/:reserveId/activate

Activates (approves) a player-team membership reservation. Once activated, the player is officially added to the team roster. Authentication: access-token: <jwt_token> — required
reserveId
string
required
The _id of the player-team reservation to activate.
Only the team manager or an authorized account should call this endpoint to prevent unauthorized roster additions.
curl -X POST https://api.example.com/api/reserve-accepts-team/64f7a8b9c0d1e2f3a4b5c6d7/activate \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
{ "status": true }

POST /api/reserve-accepts-team/get/:playerId/reservation-by-player/:pag?/:perpage?

Returns a paginated list of all join requests that a specific player has created — the player’s outgoing requests across all teams. Authentication: access-token: <jwt_token> — required
playerId
string
required
The _id of the player.
pag
number
Page number (1-based).
perpage
number
Items per page.
curl -X POST https://api.example.com/api/reserve-accepts-team/get/64e5f6a7b8c9d0e1f2a3b4c5/reservation-by-player/1/10 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of reservation documents created by the player.
pagination
object
Pagination metadata.
{
  "status": true,
  "data": [
    {
      "_id": "64f7a8b9c0d1e2f3a4b5c6d7",
      "player": "64e5f6a7b8c9d0e1f2a3b4c5",
      "team": "64b2e3d4f5a6b7c8d9e0f1a2",
      "statusType": "Pendiente"
    }
  ],
  "pagination": { "total": 2, "page": 1, "perpage": 10, "pages": 1 }
}

POST /api/reserve-accepts-team/get/:playerId/reservation-from-team/:pag?/:perpage?

Returns the team-side view of reservations involving a specific player — requests that teams have received from or sent to this player. Authentication: access-token: <jwt_token> — required
playerId
string
required
The _id of the player.
pag
number
Page number (1-based).
perpage
number
Items per page.
curl -X POST https://api.example.com/api/reserve-accepts-team/get/64e5f6a7b8c9d0e1f2a3b4c5/reservation-from-team/1/10 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of team-side reservation records for this player.
pagination
object
Pagination metadata.
{
  "status": true,
  "data": [],
  "pagination": { "total": 0, "page": 1, "perpage": 10, "pages": 0 }
}

POST /api/reserve-accepts-team/get/:teamId/reservation-by-team/:pag?/:perpage?

Returns all join requests that a specific team has received — the team’s incoming player requests waiting for review. Authentication: access-token: <jwt_token> — required
teamId
string
required
The _id of the team.
pag
number
Page number (1-based).
perpage
number
Items per page.
curl -X POST https://api.example.com/api/reserve-accepts-team/get/64b2e3d4f5a6b7c8d9e0f1a2/reservation-by-team/1/10 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of reservation documents where this team is the target.
pagination
object
Pagination metadata.
{
  "status": true,
  "data": [
    {
      "_id": "64f7a8b9c0d1e2f3a4b5c6d7",
      "player": "64e5f6a7b8c9d0e1f2a3b4c5",
      "team": "64b2e3d4f5a6b7c8d9e0f1a2",
      "statusType": "Pendiente"
    }
  ],
  "pagination": { "total": 1, "page": 1, "perpage": 10, "pages": 1 }
}

POST /api/reserve-accepts-team/get/:teamId/reservation-from-player/:pag?/:perpage?

Returns the player-side view of reservations for a specific team — how players see their own requests targeted at this team. Authentication: access-token: <jwt_token> — required
teamId
string
required
The _id of the team.
pag
number
Page number (1-based).
perpage
number
Items per page.
curl -X POST https://api.example.com/api/reserve-accepts-team/get/64b2e3d4f5a6b7c8d9e0f1a2/reservation-from-player/1/10 \
  -H "access-token: <jwt_token>"
status
boolean
true on success.
data
array
Array of player-perspective reservation records for this team.
pagination
object
Pagination metadata.
{
  "status": true,
  "data": [
    {
      "_id": "64f7a8b9c0d1e2f3a4b5c6d7",
      "player": "64e5f6a7b8c9d0e1f2a3b4c5",
      "team": "64b2e3d4f5a6b7c8d9e0f1a2",
      "statusType": "Aceptado"
    }
  ],
  "pagination": { "total": 1, "page": 1, "perpage": 10, "pages": 1 }
}

Status Enum Reference

Use the status values below exactly as shown — they are case-sensitive strings stored in MongoDB.
ValueUsed inDescription
"Pendiente"Both reservation typesInitial state; awaiting a decision
"Aceptado"Both reservation typesApproved — team admitted to event, or player added to team
"Rechazado"Both reservation typesDenied by the reviewing party
"Cancelado"Both reservation typesWithdrawn before a decision was made

Build docs developers (and LLMs) love