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/reservations endpoint provides full administrative access to the reservation store. Both methods require a valid admin_session cookie obtained from POST /api/admin/login. In production the reservation data is persisted in Vercel KV; locally, an in-memory global array is used as a fallback.
GET /api/admin/reservations
Fetches every reservation in the system, sorted ascending by date and time.Request
Response
HTTP 200reserva:id:* keys in Vercel KV, then sorted ascending by the combined "YYYY-MM-DD HH:MM" string ("${fecha} ${hora}"). The array is empty ([]) when no reservations exist.
Array of all reservations in the system.
Error responses
| Status | Body | Reason |
|---|---|---|
| 401 | { "error": "No autorizado" } | Missing or invalid session cookie |
| 500 | { "error": "Internal Server Error" } | Unexpected server error |
DELETE /api/admin/reservations
Removes a single reservation from the system by its ID. The operation deletes all related KV keys and updates the owning user’s reservation list.Request
Request body
The unique ID of the reservation to delete. Must correspond to an existing
reserva:id:{id} key in Vercel KV.Success response
HTTP 200Always
true when the reservation was found and successfully deleted.Error responses
| Status | Body | Reason |
|---|---|---|
| 400 | { "error": "ID is required" } | id field missing from request body |
| 401 | { "error": "No autorizado" } | Missing or invalid session cookie |
| 404 | { "error": "Reservation not found" } | No reservation exists with that ID |
| 500 | { "error": "Internal Server Error" } | Unexpected server error |
What DELETE does
The following KV operations are performed in sequence:- Fetches the reservation object from
reserva:id:{id}to retrieve the professional name, date, and time. - Deletes the slot lock key
reserva:{profesional}:{fecha}:{hora}, freeing the time slot for new bookings. - Deletes the ID index key
reserva:id:{id}. - Reads
user:{chatId}:reservas, filters out the entry whoseidmatches, and writes the updated array back to KV.