The Players API manages individual athlete profiles within Gestor Deportivo. A player profile stores biographical data, position preferences, and all in-game statistics (goals, cards, fouls). Before a player can be added to a team roster, they must be registered and then activated via an email confirmation code — ensuring every player profile is tied to a verified account.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.Player Lifecycle
New players go through a three-stage lifecycle before they can appear in tournament rosters:- Register — Create the player profile. The player is stored with
activate: falseand an activation code is emailed to the authenticated user. - Activate — Submit the code received by email. Sets
activate: true. - Add to team — Once active, use the Teams API to assign the player to a roster with a position and shirt number.
Position Codes
All position fields (myPosition on a player profile, position on a roster entry) use the following codes:
| Code | Full Name | Category |
|---|---|---|
GK | Goalkeeper | Goalkeeper |
CB | Centre-Back | Defender |
LB | Left-Back | Defender |
RB | Right-Back | Defender |
LWB | Left Wing-Back | Defender |
RWB | Right Wing-Back | Defender |
CDM | Central Defensive Midfielder | Midfielder |
CM | Central Midfielder | Midfielder |
CAM | Central Attacking Midfielder | Midfielder |
LM | Left Midfielder | Midfielder |
RM | Right Midfielder | Midfielder |
LW | Left Winger | Forward |
RW | Right Winger | Forward |
CF | Centre Forward | Forward |
ST | Striker | Forward |
Registration & Activation
Register a Player
POST /api/player/register
Creates a new player profile linked to the authenticated user’s account. The player starts as inactive (activate: false). An activation code is automatically sent to the user’s registered email address.
Auth required: Yes
Full name of the player.
Player’s gender.
Player height (in centimetres).
Municipality / city of origin.
Department / state / province of origin.
Player age in years.
Preferred position code (e.g.
GK, ST). See the position codes
table above.Profile photo (multipart/form-data). Optional.
After this call, check the authenticated user’s email inbox for the
activation code and pass it to Activate a Player.
Activate a Player
POST /api/player/activate/:playerId/player
Confirms the player profile using the code sent by email during registration. On success, activate is set to true and the player becomes eligible to join team rosters.
Auth required: Yes
MongoDB ObjectId of the player to activate.
The activation code received by email.
Profile Management
Update a Player
POST /api/player/update/:playerId/player
Updates biographical and positional data for an existing player. All body fields are optional — send only the fields you want to change. Supplying a new avatar file replaces the existing image.
Auth required: Yes
MongoDB ObjectId of the player to update.
Updated full name.
Updated gender.
Updated height in centimetres.
Updated municipality.
Updated department / state.
Updated age.
Updated preferred position code. See position codes.
Replacement profile photo (multipart/form-data).
Delete a Player
POST /api/player/remove/:playerId
Permanently deletes a player profile and removes them from any team rosters.
Auth required: Yes
MongoDB ObjectId of the player to delete.
Get Player by ID
POST /api/player/:playerId
Fetches the full profile document for a single player, including all stat arrays.
Auth required: Yes
MongoDB ObjectId of the player.
Listing & Search
List All Players
POST /api/player/to-alls
Returns a paginated list of all player profiles accessible to the authenticated user.
Auth required: Yes
List Players by Activation Status
POST /api/player/to-list-inactive/:activeParam/:pag?/:perpage?
Filters players by their activation status. Pass "true" to list activated players, "false" to list pending/unactivated players.
Auth required: Yes
"true" — return only activated players (activate: true)."false" — return only unactivated players (activate: false).Page number (1-based). Defaults to
1.Results per page.
Search Players
POST /api/player/search-player/:query/:pag?/:perpage?
Case-insensitive search across namePlayer. Useful for autocomplete fields in tournament management UIs.
Auth required: No
Search term matched against player names.
Page number (1-based). Defaults to
1.Results per page.
Player Model
Every player document returned by the API follows this schema.MongoDB ObjectId.
Embedded owner snapshot at the time of creation.
System-generated unique player code.
Full name of the player.
Player’s gender.
Height in centimetres.
Municipality of origin.
Department / state of origin.
Age in years.
true if the player has been verified via email code; false until then.Array of image metadata objects for the player’s profile photo.
Preferred position details.
Array of team ObjectIds the player is currently rostered on.
Statistics Arrays
Each stat field is stored as an array of entries rather than a flat counter, enabling per-match breakdowns and audit trails.Records of goals scored by this player.
Records of own goals conceded by this player.
Penalty kick records (scored or missed).
Active disciplinary sanctions.
All fouls/faults committed.
Yellow card incidents.
Red card incidents.
Blue card incidents (used in futsal and some indoor formats).