The Teams API is the core of Gestor Deportivo’s tournament management system. It lets authenticated users create and configure teams within their subscription plan limits, build rosters by assigning players to positions, transfer players between teams, and expose public search and listing endpoints for tournament brackets and standings pages.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.
Every request that requires authentication must include the header
access-token: <jwt_token>. There is no Authorization: Bearer header on
this API.Team CRUD
Register a Team
POST /api/team/register-team
Creates a new team under the authenticated user’s account. The nameTeam value is automatically formatted to Title Case before being stored. Team creation is gated by the user’s subscription plan — see the Memberships guide for per-plan limits.
Auth required: Yes
Plan limits: Plan Gratis = 1 team · Plan Básico = 3 teams · Plan Premium =
10 teams. Admin accounts bypass all limits.
Display name for the team. Automatically converted to Title Case (e.g.
"real madrid cf" → "Real Madrid Cf").Short description of the team.
Team crest / logo image (multipart/form-data). Optional.
Banner image displayed on the team profile (multipart/form-data). Optional.
Update Team Info
POST /api/team/updating/:teamId/team
Updates the name, description, and/or images of an existing team. Only the team owner can call this endpoint. All fields are optional — send only what needs to change.
Auth required: Yes (owner only)
MongoDB ObjectId of the team to update.
New team name. Converted to Title Case automatically.
Updated team description.
Replacement crest image (multipart/form-data).
Replacement banner image (multipart/form-data).
Delete a Team
POST /api/team/remove/:teamId/team
Permanently deletes a team and its associated data. Only the team owner can perform this action.
Auth required: Yes (owner only)
MongoDB ObjectId of the team to delete.
Roster Management
Update Team Roster (Assign Players)
POST /api/team/updating/:teamId/players
Adds or updates players on a team’s roster, assigning each player a shirt number and a position code. If a player is already on the roster, their entry is updated; new players are appended.
Auth required: Yes (owner only)
MongoDB ObjectId of the team.
Array of player assignment objects. Each object must include:
| Field | Type | Description |
|---|---|---|
_id | string | Player’s MongoDB ObjectId |
shirtNumber | number | Jersey number |
position | string | Position code (see table below) |
| Code | Position |
|---|---|
GK | Goalkeeper |
CB | Centre-Back |
LB | Left-Back |
RB | Right-Back |
LWB | Left Wing-Back |
RWB | Right Wing-Back |
CDM | Central Defensive Mid |
CM | Central Midfielder |
CAM | Central Attacking Mid |
LM | Left Midfielder |
RM | Right Midfielder |
LW | Left Winger |
RW | Right Winger |
CF | Centre Forward |
ST | Striker |
Remove a Player from a Team
POST /api/team/remove/:teamId/-/:playerId/player
Removes a single player from a team’s roster. The - segment is a literal path separator required by the route definition.
Auth required: Yes (owner only)
MongoDB ObjectId of the team.
MongoDB ObjectId of the player to remove.
Player Transfers
For a full walkthrough of the two-step transfer workflow, see the Player
Transfers guide.
- Initiate — The source team owner (or any authenticated user) calls the initiate endpoint, which creates a pending
TransferPlayerrecord. - Accept — The destination team owner calls the accept endpoint to confirm the transfer and move the player to the new roster.
Initiate a Transfer
POST /api/team/transfer/:playerId/-/:sourceTeamId/player
Opens a transfer request for a player from the source team to a destination team. A TransferPlayer record is created with a pending status. The - segment is a literal path separator.
Auth required: Yes
MongoDB ObjectId of the player being transferred.
MongoDB ObjectId of the team the player is currently on.
MongoDB ObjectId of the team that should receive the player.
Accept a Transfer
POST /api/team/accepts/:destinationTeamId/transfer
Confirms a pending transfer request. The player is removed from the source team’s roster and added to the destination team’s roster. Only the owner of the destination team can call this endpoint.
Auth required: Yes (destination team owner only)
MongoDB ObjectId of the destination team. The API resolves the pending
transfer record automatically.
Listing & Search
List All Teams (Paginated)
POST /api/team/to-list/:pag?/:perpage?
Returns a lightweight paginated list of all teams. Each item contains only _id, nameTeam, description, and teamImg — suitable for dropdowns and index pages.
Auth required: No
Page number (1-based). Defaults to
1.Results per page. Defaults to the server-configured value.
Get Team Detail
POST /api/team/to/:teamId/list-team
Returns the full team document including the populated players roster array.
Auth required: No
MongoDB ObjectId of the team.
List My Teams
POST /api/team/to-list-own
Returns all teams owned by the currently authenticated user.
Auth required: Yes
Search Teams
POST /api/team/search/-/team/:query/:pag?/:perpage?
Full case-insensitive text search across nameTeam. The - segment is a literal path separator.
Auth required: No
Search term matched against team names (case-insensitive regex).
Page number (1-based). Defaults to
1.Results per page.