The Attendances API provides a read-only view of every gym check-in event recorded in the system. It is designed for reporting and roster review — managers can filter by date range, client status, plan, or search term to produce attendance reports. The actual act of recording a new check-in is performed through the client-scoped endpointDocumentation 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.
POST /api/clients/:id/attendance, which is fully documented on the Clients page. All attendance endpoints require a valid Bearer token and are accessible to any authenticated role.
The Attendance Object
Each item in the response array is a flattened object that combines the core attendance record with a snapshot of the related client’s details at query time.Auto-incremented integer identifier for the attendance record.
UUID of the client who checked in.
ID of the staff
User who registered the attendance, or null if the user account has since been deleted (onDelete: SetNull).ISO 8601 datetime of the check-in event. Stored in UTC; use the companion
hora field for a human-readable local time.Check-in time formatted as
HH:MM AM/PM in the America/Mexico_City timezone (e.g. "09:45 AM").ISO 8601 datetime when the record was persisted.
Client’s first name at query time.
Client’s last name(s) at query time.
Client’s phone number at query time.
Name of the plan the client was enrolled in at query time.
Payment method on the client’s current membership.
Client’s membership status at query time (
ACTIVO, VENCIDO, or PENDIENTE).Client’s profile photo URL, or
null.Client’s current membership expiry datetime (ISO 8601).
Snapshot of the staff user who registered the check-in, or
null.Endpoints
List Attendance Records
Requires a valid Bearer token. Accessible to all roles (
admin and recepcionista).fecha. All query parameters are optional and combinable.
Start date for filtering records, formatted as
YYYY-MM-DD. Interpreted as the start of that calendar day in the America/Mexico_City timezone (UTC-6 offset used for boundary calculation). Results include records from this date onward.End date for filtering, formatted as
YYYY-MM-DD. If provided alongside fechaInicio, results are bounded to the inclusive date range [fechaInicio, fechaFin]. If equal to fechaInicio, only records for that single day are returned.Filter by client membership status. Accepted values:
ACTIVO, VENCIDO, PENDIENTE. Pass Todos or omit to include all statuses.Filter by client plan name. Pass
Todos los planes, Cualquiera, or omit to include all plans.Case-insensitive substring search across the related client’s
nombre, apellidos, and telefono fields.200 OK
| Status | Description |
|---|---|
401 | Missing or invalid Bearer token. |
403 | Authenticated user does not have the required role. |
500 | Internal server error. |
Attendance Guards
When a check-in is submitted viaPOST /api/clients/:id/attendance, two server-side guards execute before the record is persisted. Understanding them helps you handle the relevant error codes correctly.
Membership Expiry Guard
Before writing any record, the controller comparesclient.vencimiento against the current date. Both values have their time components zeroed out (set to 00:00:00.000) before the comparison, so a membership that expires at any point during today is still considered valid for the whole calendar day.
If expiryDate < today (date-only comparison), the endpoint returns:
403 Forbidden.
Duplicate Attendance Guard
The system allows each client to check in at most once per calendar day. It queries for an existingAttendance record matching:
attendanceDate already matches today’s date — the endpoint returns:
400 Bad Request.