The Config API manages the singleDocumentation 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.
GymConfig record that drives your gym’s identity across the application — the name shown in the header, the contact information on receipts, and the logo displayed in the navigation bar. There is always exactly one configuration row; if it has not been seeded, the server auto-creates it with sensible defaults on first read. Logo uploads go through a dedicated multipart endpoint that stores the file in Cloudinary, returning a CDN URL you then persist via PUT /api/config/gym.
All endpoints on this page require an admin Bearer token.
GymConfig Object
Auto-incremented primary key. Always
1 in a freshly seeded database.Display name of the gym. Default:
"SPARTAN'S GYM".Contact email address. Default:
"contacto@spartansgym.com".Contact phone number. Default:
"+52 55 1234 5678".Physical address. Default:
"Avenida de los Deportes 123, Ciudad de México".Cloudinary CDN URL of the gym’s logo image, or
null if no logo has been uploaded.UTC timestamp of record creation.
UTC timestamp of the most recent update.
GET /api/config/gym
Retrieve the current gym configuration. If no record exists yet (first boot), the server creates one with the default values listed above before responding. Auth:Authorization: Bearer <token> — admin only
Success Response — 200
Error Responses
| Status | Meaning |
|---|---|
401 | Missing or invalid Bearer token |
403 | Authenticated user is not an admin |
500 | Internal server error |
PUT /api/config/gym
Update one or more fields of the gym configuration. Only the fields you include are changed — all others retain their current values. You may also passlogo directly with a URL string if you already have one; the typical flow is to upload via POST /api/upload/logo first to obtain a Cloudinary URL, then pass it here.
Auth: Authorization: Bearer <token> — admin only
Request Body
All fields are optional. Send only the fields you want to change.Updated gym display name.
Updated contact email.
Updated contact phone number.
Updated physical address.
Cloudinary CDN URL to store as the gym’s logo. Obtain this value from the
POST /api/upload/logo response before calling this endpoint.Success Response — 200
Error Responses
| Status | Meaning |
|---|---|
401 | Missing or invalid Bearer token |
403 | Authenticated user is not an admin |
500 | Internal server error |
Example
POST /api/upload/logo
Upload a gym logo image to Cloudinary. The file is delivered asmultipart/form-data with the field name logo. Cloudinary resizes the image to a maximum of 200 × 200 px, applies automatic quality and format optimisation, and returns a permanent CDN URL.
Auth: Authorization: Bearer <token> — admin only
Request
- Content-Type:
multipart/form-data - Form field:
logo— the image file (accepted MIME types:image/*)
gym-logos Cloudinary folder and transformed automatically:
- Crop mode:
limit(shrinks to fit 200 × 200, never upscales) - Quality:
auto - Format:
auto(serves WebP/AVIF where supported)
Success Response — 200
The
secure_url from Cloudinary — an HTTPS CDN link ready to be stored in GymConfig.logo.Cloudinary asset identifier (e.g.
"gym-logos/logo_abc123"). Retain this if you need to delete or transform the asset via the Cloudinary API later.Error Responses
| Status | Body error | Meaning |
|---|---|---|
400 | "No se proporcionó ninguna imagen" | No file was attached to the logo field |
401 | — | Missing or invalid Bearer token |
403 | — | Authenticated user is not an admin |
500 | "Error al subir el logo" | Cloudinary upload failure |
Example
Logo Update Flow
The full two-step process for replacing the gym logo:There is no server-side file size limit enforced by multer beyond what Cloudinary accepts. The frontend enforces a 5 MB soft cap before uploading. If you call this endpoint directly, keep files under 5 MB to stay consistent with the expected behaviour.