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 supports image uploads across users, teams, clubs, events, players, and notices. The API uses multer to parse incoming multipart/form-data requests and then stores the resulting files in Google Cloud Storage, returning permanent public URLs in the response.

How uploads work

When an endpoint accepts file uploads, you must send the request as multipart/form-data rather than JSON. Each upload endpoint defines one or more named fields that correspond to a specific image slot (e.g., a team logo vs. a banner). The server processes each field independently, so you can upload one or both files in a single request.
Google Cloud Storage credentials must be correctly configured on the server before any upload endpoint will function. If the credentials are missing or expired, file uploads will fail at the storage step even if the rest of the request is valid.

Upload fields by endpoint

EndpointField Name(s)Input Type
POST /api/user/registeravatararray
POST /api/user/update-user/:userIdavatararray
POST /api/team/register-teamteamImg, bannerImgnamed fields
POST /api/team/updating/:teamId/teamteamImg, bannerImgnamed fields
POST /api/club/register-clubclubImg, bannerImgnamed fields
POST /api/event/agregateeventsImgarray
POST /api/event/update/:eventId/eventeventsImgarray
POST /api/player/registeravatararray
POST /api/player/update/:playerId/playeravatararray
POST /api/notice/register-notice/:eventIdnoticeImg, videoUrlnamed fields

Uploading files with curl

The example below registers a new team and uploads both a team logo and a banner image in a single multipart/form-data request.
curl -X POST https://your-api.com/api/team/register-team \
  -H "access-token: YOUR_JWT_TOKEN" \
  -F "nameTeam=FC Example" \
  -F "description=A great team" \
  -F "teamImg=@/path/to/logo.jpg" \
  -F "bannerImg=@/path/to/banner.jpg"
Notice that the Content-Type header is not set manually — curl sets it to multipart/form-data automatically when you use -F flags.

Response format

After a successful upload, the stored images are returned inside the resource object as arrays of objects, each containing a url property pointing to the Google Cloud Storage location:
{
  "status": true,
  "msj": "Equipo registrado correctamente",
  "data": {
    "_id": "64c3f...",
    "nameTeam": "FC Example",
    "description": "A great team",
    "teamImg": [
      { "url": "https://storage.googleapis.com/your-bucket/teamImg/logo.jpg" }
    ],
    "bannerImg": [
      { "url": "https://storage.googleapis.com/your-bucket/bannerImg/banner.jpg" }
    ]
  }
}
teamImg
array
Array of image objects. Each object contains a url string pointing to the uploaded file in Google Cloud Storage.
bannerImg
array
Array of banner image objects, each with a url string.

Uploading a user avatar

curl -X POST https://your-api.com/api/user/register \
  -F "firstName=Carlos" \
  -F "lastName=Ramírez" \
  -F "email=carlos@example.com" \
  -F "password=MySecurePass123" \
  -F "sex=Masculino" \
  -F "avatar=@/path/to/profile.jpg"

Uploading a notice with an image

curl -X POST https://your-api.com/api/notice/register-notice/EVENT_ID \
  -H "access-token: YOUR_JWT_TOKEN" \
  -F "title=Match Recap" \
  -F "content=Full match summary here" \
  -F "noticeImg=@/path/to/photo.jpg" \
  -F "videoUrl=https://youtube.com/watch?v=abc123"
Endpoints that do not accept file uploads expect Content-Type: application/json. Sending multipart/form-data to a JSON-only endpoint may cause fields to be parsed incorrectly or ignored. Always match the content type to what the endpoint requires.

Build docs developers (and LLMs) love