TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shadownrx/apisquare/llms.txt
Use this file to discover all available pages before exploring further.
/api/admin/config endpoint manages the live bot configuration — the professionals and their weekly schedules, available services, and public holidays. Changes made through this endpoint take effect immediately; the Telegram bot reads the configuration fresh from Vercel KV on every incoming message without requiring a deployment or restart. Both methods require admin authentication via the admin_session cookie.
GET /api/admin/config
Returns the active configuration, merged with built-in defaults to guarantee all required fields are present.Request
Response
HTTP 200DEFAULT_CONFIG. Professional entries from both the default and stored configs are combined via object spread ({...DEFAULT_CONFIG.profesionales, ...storedConfig.profesionales}), so every default professional is always present unless explicitly overridden. If the stored servicios array is empty, the default services list is used as a fallback.
Config object schema
The full bot configuration object.
Error responses
| Status | Body | Reason |
|---|---|---|
| 401 | { "error": "No autorizado" } | Missing or invalid session cookie |
| 500 | { "error": "Error interno" } | Unexpected server error |
PUT /api/admin/config
Replaces the entire bot configuration stored in Vercel KV under the keyapp:config.
Request
Request body
The full config object as described in the GET response schema. All three top-level fields are required.Map of professional name → weekly schedule. Same structure as returned by GET. Must be a non-null, non-array object.
Array of holiday date strings in
YYYY-MM-DD format. Pass an empty array ([]) if there are no holidays.Array of service objects (
{ nombre, duracionMinutos, precio }). Must be a non-null array; passing an empty array will remove all bookable services from the bot.Validation
The server checks that the request body contains all three required top-level keys before persisting:profesionalesmust be present (truthy).feriadosmust be present and be an array (Array.isArray).serviciosmust be present and be an array (Array.isArray).
Success response
HTTP 200Always
true when the configuration was saved successfully.The configuration object exactly as persisted to Vercel KV (mirrors the PUT request body).
Error responses
| Status | Body | Reason |
|---|---|---|
| 400 | { "error": "Estructura de configuración inválida" } | Missing or wrong-typed top-level field |
| 401 | { "error": "No autorizado" } | Missing or invalid session cookie |
| 500 | { "error": "Error interno" } | Unexpected server error |
Storage details
The configuration is persisted as a JSON string under the Vercel KV keyapp:config. No TTL is set — the value persists until the next PUT. In local development, when KV environment variables are absent, the config is stored in a server-side global variable (global._localAppConfig) and resets on process restart.
Because the Telegram bot reads
app:config from KV on every incoming message, configuration changes applied via PUT take effect for the very next user interaction — no redeployment is required.