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.

Clubs are the organizational layer above teams in Gestor Deportivo. Think of a club as the parent institution — an Academia, a Club, or an Escuela de fútbol — that owns and groups multiple teams under a single brand. A football club might have a men’s first team, a women’s team, and a youth academy side all associated with the same club record. When you link a team to a club, the relationship is bidirectional: the team appears in the club’s teams array, and the club reference is added to the team’s club array simultaneously.
Every request that requires authentication must include the header access-token: <jwt_token>. There is no Authorization: Bearer header on this API.

Club Categories

When creating a club, the category field must be one of the following:
ValueDescription
AcademiaA football academy, typically youth-focused
ClubA full sports club with competitive teams
Escuela de futbolA football school / development programme

Club Management

Register a Club

POST /api/club/register-club Creates a new club linked to the authenticated user’s account. You can supply a club crest and banner image at creation time. The founded field is flexible — it accepts a year string (e.g. "1987") or a founder’s name depending on your data model preference. Auth required: Yes
nameClub
string
required
Official name of the club.
description
string
required
Short description or motto for the club.
category
string
required
One of "Academia", "Club", or "Escuela de futbol".
founded
string
required
Year the club was founded (e.g. "1987") or the founder’s name.
clubImg
file
Club crest / logo (multipart/form-data). Optional.
bannerImg
file
Banner image for the club profile page (multipart/form-data). Optional.
curl -X POST https://api.example.com/api/club/register-club \
  -H "access-token: <jwt_token>" \
  -F "nameClub=Deportivo del Valle" \
  -F "description=Club formativo del Valle del Cauca" \
  -F "category=Club" \
  -F "founded=2005" \
  -F "clubImg=@/path/to/crest.png" \
  -F "bannerImg=@/path/to/banner.jpg"

Listing Clubs

List All Clubs (Paginated)

POST /api/club/list-clubs/:pag?/:perpage? Returns a paginated list of all clubs in the system. No authentication required — suitable for public tournament and league pages. Auth required: No
pag
number
Page number (1-based). Defaults to 1.
perpage
number
Number of results per page.
curl -X POST https://api.example.com/api/club/list-clubs/1/20

List My Clubs

POST /api/club/list-my-clubs Returns all clubs that belong to the authenticated user. Use this endpoint to build the club management dashboard. Auth required: Yes
curl -X POST https://api.example.com/api/club/list-my-clubs \
  -H "access-token: <jwt_token>"

Team Association

Add a Team to a Club

POST /api/club/add-to-team-club/:clubId/:teamId Links a team to a club. This operation is bidirectional:
  • The team is added to the club’s teams array (as a snapshot).
  • The club reference is added to the team’s club array.
Both sides of the relationship are written atomically, so you never need to manually update the team record. Auth required: Yes
clubId
string
required
MongoDB ObjectId of the club.
teamId
string
required
MongoDB ObjectId of the team to associate with the club.
curl -X POST https://api.example.com/api/club/add-to-team-club/64d4e5f6a7b8c9d0e1f01234/64a1f2c3e4b0d5f6a7890123 \
  -H "access-token: <jwt_token>"
Bidirectional update: After this call, GET-equivalent queries for the club will show the team in club.teams, and queries for the team will show the club reference in team.club. You do not need to call any additional endpoint to synchronise the relationship.

Club Model

Every club document returned by the API follows this schema.
_id
string
MongoDB ObjectId of the club.
nameClub
string
Official name of the club.
description
string
Club description or motto.
category
string
Club type: "Academia", "Club", or "Escuela de futbol".
founded
string
Founding year or founder name.
clubImg
array
Array of image metadata objects for the club crest.
bannerImg
array
Array of image metadata objects for the club banner.
teams
array
Array of team snapshot objects linked to this club. Each snapshot is written at association time and reflects the team’s state at that moment.
user
object
Embedded owner snapshot.

Build docs developers (and LLMs) love