The Dashboard API exposes a single aggregated statistics endpoint that powers the main management screen. It queries attendance records, client memberships, and transaction history in one call, then shapes the response based on the authenticated user’s role. Admins receive full financial data; recepcionistas receive the same operational data but without revenue figures, keeping sensitive business metrics appropriately restricted.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/azahel79/Spartans-gym/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/dashboard/stats
Returns aggregated gym statistics. The response shape varies by role — see the field reference and examples below. Auth:Authorization: Bearer <token> — any authenticated role
Success Response — 200
All roles receive the base fields. Admin accounts additionally receive the three financial fields marked admin only below.Total count of all transactions ever recorded in the system (not filtered by date).
Today’s occupancy percentage:
(today's attendance count / active client count) × 100, rounded to the nearest integer and capped at 100. Returns 0 when there are no active clients.Clients whose membership expires within the next 7 days, ordered by
vencimiento ascending.The five most recent events across both transactions and attendance check-ins, merged and sorted by
createdAt descending.Today’s attendance counts bucketed into fixed two-hour slots. Always returns exactly 7 entries regardless of whether any attendance was recorded for a given hour.
Current ISO week (Monday → Sunday) with attendance and transaction counts per day. Days in the future still appear with
real: 0 and proyectado: 0.Admin only. Sum of all transaction
monto values in the current calendar month (UTC boundaries).Admin only. Hardcoded monthly revenue target:
60000 MXN.Admin only.
(ingresosTotalesMes / metaMensual) × 100, capped at 100.Error Responses
| Status | Meaning |
|---|---|
401 | Missing or invalid Bearer token |
500 | Internal server error |
Example — Admin response
Example — Recepcionista response
Recepcionista (200 OK)
The
ingresosTotalesMes, metaMensual, and porcentajeMeta fields are silently omitted from the recepcionista response — they are not set to null or 0. Client code should treat their absence as an access-controlled omission and guard accordingly (e.g. data.ingresosTotalesMes ?? null).