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.

The Admin API exposes three protected endpoints used exclusively by the administration panel. All three require a valid JWT issued to a user with the admin role. The active-season endpoint provides a quick way to resolve which season is currently live, the summary endpoint aggregates entity counts and recent audit activity for the dashboard, and the upload endpoint handles image optimisation and storage to Cloudinary via Sharp.
Returns the single season that is currently marked as active. Returns 404 if no active season exists.Method: GET Path: /admin/active-season Auth: JWT + admin role required

Response — 200 OK

id
number
Season ID.
name
string
Season name (e.g. "2024/2025").
start_date
string
Season start date.
end_date
string
Season end date.
is_active
boolean
Always true for the record returned by this endpoint.

Example

curl "https://api.futsalmanager.example/admin/active-season" \
  -H "Authorization: Bearer <token>"
Response
{
  "id": 3,
  "name": "2024/2025",
  "start_date": "2024-09-01",
  "end_date": "2025-05-31",
  "is_active": true
}
Returns entity counts (teams, players, pending matches) and the five most recent audit-log entries. When season_id is provided, counts are scoped to that season and audit log entries are filtered to those that reference the same season in their details field.Method: GET Path: /admin/summary Auth: JWT + admin role required

Query parameters

season_id
number
Season to scope the counts to. When omitted, global counts across all seasons are returned.

Response — 200 OK

stats
object
Aggregate counts for the requested scope.
recentActivity
object[]
Up to 5 most recent audit-log entries, ordered by creation date descending.

Example

curl "https://api.futsalmanager.example/admin/summary?season_id=3" \
  -H "Authorization: Bearer <token>"
Response
{
  "stats": {
    "totalTeams": 12,
    "totalPlayers": 144,
    "pendingMatches": 8
  },
  "recentActivity": [
    {
      "id": 201,
      "user_id": 1,
      "username": "admin",
      "action": "Creación de equipo",
      "entity_type": "team",
      "entity_id": 15,
      "details": { "name": "CD Nuevo", "season_id": "3" },
      "created_at": "2025-01-10T14:32:00.000Z"
    }
  ]
}
Accepts a multipart/form-data request with a single image file, processes it through Sharp for optimisation, and uploads the result to Cloudinary. Returns the public URL of the stored image.Method: POST Path: /admin/upload Auth: JWT + admin role required Content-Type: multipart/form-data

Query parameters

folder
string
default:"general"
Cloudinary folder to store the image in (e.g. "teams", "players").
filename
string
Optional custom public ID for the uploaded asset. When omitted, Cloudinary generates one.

Form fields

image
file
required
The image file to upload. Accepted via the image multipart field name.

Response — 200 OK

url
string
Public Cloudinary URL of the uploaded image.

Example

curl -X POST "https://api.futsalmanager.example/admin/upload?folder=teams&filename=atletico-norte" \
  -H "Authorization: Bearer <token>" \
  -F "image=@/path/to/logo.png"
Response
{
  "url": "https://res.cloudinary.com/yourcloud/image/upload/teams/atletico-norte.webp"
}

Build docs developers (and LLMs) love