The Clients API is the core of Spartans Gym’s member management. It covers the full member lifecycle: enrolling new clients with a plan and payment, querying and filtering the member roster, editing member details, recording daily gym check-ins, renewing expiring memberships, and removing former members. All endpoints require a valid Bearer token. Write operations are split by role — front-desk staff (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.
recepcionista) can read and enroll; only admin users may edit or delete records.
The Client Object
Every successful response wraps a Client object (or an array of them) inside adata field alongside "success": true.
UUID. Unique identifier for the client record.
First name of the client.
Last name(s) of the client.
Biological gender. One of
Masculino, Femenino, or Otro.Phone number used as the primary contact identifier and search key.
Name of the active membership plan the client is enrolled in.
Amount paid (MXN) for the current membership period.
Payment method used. One of
Efectivo, Tarjeta, or Transferencia.Membership status. One of
ACTIVO, VENCIDO, or PENDIENTE.Time of the client’s last gym check-in, formatted as
HH:MM AM/PM in the America/Mexico_City timezone. Defaults to --:-- until the first attendance is recorded.ISO 8601 datetime string representing when the current membership expires.
URL of the client’s profile photo, or
null if none has been set.ISO 8601 datetime of the most recent attendance record, or
null if the client has never checked in.ISO 8601 datetime when the client record was created.
ISO 8601 datetime when the client record was last modified.
Endpoints
List Clients
Requires role
admin or recepcionista.Case-insensitive substring search across
nombre, apellidos, and telefono.Filter by membership status. Accepted values:
ACTIVO, VENCIDO, PENDIENTE.Filter by exact plan name (e.g.
"Mensual", "Trimestral").200 OK
| Status | Description |
|---|---|
401 | Missing or invalid Bearer token. |
403 | Authenticated user does not have the required role. |
500 | Internal server error. |
Get Client by ID
Requires role
admin or recepcionista.The client’s UUID.
200 OK
Returns a single Client object wrapped in data.
Error Responses
| Status | Description |
|---|---|
401 | Missing or invalid Bearer token. |
403 | Insufficient role. |
404 | No client found with the given ID. |
500 | Internal server error. |
Create Client
Requires role
admin or recepcionista.plan value must match the name of an existing active plan. The system automatically calculates the vencimiento date from the plan’s period field (defaulting to 1 month if the period cannot be parsed). The new client’s status is set to ACTIVO immediately.
Client’s first name.
Client’s last name(s).
Gender identity. Must be one of
Masculino, Femenino, or Otro.Phone number. Used as the primary search key; does not need to be unique.
Exact name of an active membership plan. Returns
400 if the plan does not exist or is inactive.Amount paid for this enrollment (MXN).
Payment method. One of
Efectivo, Tarjeta, or Transferencia.Optional URL to a profile photo.
201 Created
| Status | Description |
|---|---|
400 | Missing required fields, invalid genero value, or plan not found / inactive. |
401 | Missing or invalid Bearer token. |
403 | Insufficient role. |
500 | Internal server error. |
Update Client
Partially updates an existing client. Supply only the fields you wish to change; omitted fields retain their current values.UUID of the client to update.
Updated first name.
Updated last name(s).
Updated gender. One of
Masculino, Femenino, Otro.Updated phone number.
Updated plan name. Does not recalculate
vencimiento; use the /renew endpoint for a full renewal.Updated amount.
Updated payment method. One of
Efectivo, Tarjeta, Transferencia.Pass a URL to set a new photo, or explicitly pass
null to clear it.200 OK
Returns the full updated Client object inside data.
Error Responses
| Status | Description |
|---|---|
401 | Missing or invalid Bearer token. |
403 | User is not an admin. |
404 | No client found with the given ID. |
500 | Internal server error. |
Delete Client
Permanently deletes a client and all of their attendance history.UUID of the client to delete.
200 OK
| Status | Description |
|---|---|
401 | Missing or invalid Bearer token. |
403 | User is not an admin. |
404 | No client found with the given ID. |
500 | Internal server error. |
Register Attendance
Requires role
admin or recepcionista. No request body is needed.- Membership expiry check — compares
client.vencimientoagainst today’s date (time components are zeroed). Returns403if the membership has expired. - Duplicate attendance check — queries for an existing
Attendancerecord whosefechafalls within[startOfToday, startOfTomorrow). Returns400if one already exists.
ultimaVisita (formatted as HH:MM AM/PM, America/Mexico_City) and attendanceDate fields on the Client are updated in the same database transaction as the new Attendance record.
UUID of the client checking in.
200 OK
| Status | Description |
|---|---|
400 | Client has already checked in today. |
401 | Missing or invalid Bearer token. |
403 | Client’s membership has expired. |
404 | No client found with the given ID. |
500 | Internal server error. |
Renew Membership
Requires role
admin or recepcionista.vencimiento (if it is still in the future) or today. This means a renewal applied before expiry stacks on top of the remaining time. The client’s status is set back to ACTIVO upon renewal.
UUID of the client to renew.
Exact name of an active plan to assign. Returns
400 if the plan does not exist or is inactive.Amount paid for the renewal (MXN).
Payment method. One of
Efectivo, Tarjeta, or Transferencia.200 OK
| Status | Description |
|---|---|
400 | Plan not found or inactive. |
401 | Missing or invalid Bearer token. |
403 | Insufficient role. |
404 | No client found with the given ID. |
500 | Internal server error. |