AllDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta2/llms.txt
Use this file to discover all available pages before exploring further.
/admin/* endpoints are restricted to authenticated users with the admin role. You must include a valid JWT in every request. Non-admin tokens receive 403 Forbidden; missing or expired tokens receive 401 Unauthorized.
Authentication requirement
Every request to an/admin/* endpoint must include the following header:
401. If the token is valid but the user’s role is not admin, the server responds with 403.
GET /admin/summary
Returns dashboard statistics for the admin panel. All counts can be scoped to a specific season via the optionalseason_id query parameter.
Query parameters
Filter stats and recent activity to a specific season. Omit to return global counts.
Response
Aggregate counts for the league.
The five most recent audit log entries, optionally filtered by season.
Example
cURL
GET /admin/active-season
Returns the currently active season object. Returns404 if no season has is_active = true.
GET /admin/logs
Paginated list of all audit log entries. Supports filtering by season, username, and date.Query parameters
Page number (1-indexed).
Number of entries per page.
Filter entries to a specific season (includes entries with no season).
Case-insensitive partial match on the acting user’s username.
Exact date filter in
YYYY-MM-DD format.Response
Array of audit log entries matching the filters. See the entry structure above under
recentActivity.Total number of matching entries (for pagination).
Current page number.
Page size used for this response.
GET /admin/users
Returns a paginated list of all active users with their roles and account metadata.Query parameters
Case-insensitive partial match on username or email.
Page number.
Results per page.
Response
List of user objects containing
id, username, email, role, and created_at.Total active users matching the query.
Current page.
Page size.
PUT /admin/users/:id
Updates the role of a user. Valid roles areadmin, referee, and user.
Path parameters
ID of the user to update.
Request body
New role to assign. One of
admin, referee, or user.DELETE /admin/users/:id
Deactivates a user account and anonymizes their username and email. This is a soft delete — the user record is retained but the account becomes inaccessible.Path parameters
ID of the user to deactivate.
Every action performed through the admin endpoints is automatically recorded in the
audit_logs table, including the acting admin’s ID, the affected entity, and a JSONB details payload.