Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526/llms.txt

Use this file to discover all available pages before exploring further.

Your profile is the personal hub of FutsalLeague Manager. From here you can check how many prediction points you have accumulated, see where you rank among all users, review your past match votes, manage the teams you follow, and control your account settings. All profile endpoints require a valid JWT token in the Authorization header.

Profile Overview

GET /user/profile returns a complete snapshot of your account:
  • Basic info — your username and email address.
  • Followed teams — a list of every team you currently follow, with each team’s name and logo.
  • Upcoming matches — up to 5 next fixtures for your followed teams in the active season, including current vote counts and your own vote if you have already cast one.
GET /user/profile
Authorization: Bearer <your_token>
{
  "user": { "id": 42, "username": "jane_doe", "email": "[email protected]" },
  "followedTeams": [
    { "id": 7, "name": "Rayo Indoor", "logo_url": "https://..." }
  ],
  "upcomingMatches": [
    {
      "id": 101,
      "date": "2026-05-20T18:00:00",
      "homeTeam": { "name": "Rayo Indoor", "logoUrl": "https://..." },
      "awayTeam": { "name": "Futsal Norte", "logoUrl": "https://..." },
      "status": "pendiente",
      "userVote": "local",
      "votingStats": { "local": 14, "draw": 3, "away": 9, "total": 26 }
    }
  ]
}

Prediction Points and Ranking

GET /me/predictor-stats returns your total accumulated points, your global position in the predictor ranking, and a history of your last 20 votes.
GET /me/predictor-stats
Authorization: Bearer <your_token>
{
  "totalPoints": 87,
  "globalRank": 4,
  "history": [
    {
      "match_id": 101,
      "home_team_name": "Rayo Indoor",
      "away_team_name": "Futsal Norte",
      "my_prediction": "local",
      "real_result": "local",
      "points_awarded": 1,
      "status": "finalizado"
    }
  ]
}
Each entry in history shows the match, your prediction, the actual result, and the points you were awarded for that vote (1 for a correct prediction, null or 0 for incorrect or still pending). Pending matches appear with real_result: "pendiente" and points_awarded: null.
The GET /me/predictor-stats endpoint returns your overall cumulative points and rank across all votes. For season-specific points and rankings, use GET /statistics/user-stats?season_id=X. Your vote history is shown for all votes, not filtered to a single season.

Following Teams

You can follow any team to receive fixture highlights on your profile. Calling the toggle endpoint once follows the team; calling it a second time unfollows it.
POST /teams/:id/toggle-follow
Authorization: Bearer <your_token>
Response when following:
{ "message": "Ahora sigues al equipo", "isFollowing": true }
Response when unfollowing:
{ "message": "Has dejado de seguir al equipo", "isFollowing": false }
Followed teams appear in the Followed teams section of your profile, along with their next scheduled matches in the current season.

Vote History

The same GET /me/predictor-stats endpoint described above also returns your full voting history (up to the last 20 entries). For each past vote you can see:
  • The match (home and away team names)
  • Your prediction (local, empate, or visitante)
  • The actual outcome
  • Points awarded for that prediction
  • Whether the match has finished or is still pending

Account Deactivation

You can delete your account from the profile page. This triggers an anonymisation process: your username and email are replaced with randomised values and your account is marked inactive.
DELETE /user/:id
Authorization: Bearer <your_token>
Account deactivation is permanent and irreversible. Your username, email, and login access are removed immediately. If an administrator deactivates your account instead of you, your next login attempt will return a 403 error with a clear message explaining that the account has been deactivated.

Build docs developers (and LLMs) love