Overview
The reservation system allows you to book rooms for courses, manage reservation states, and handle the complete lifecycle from initial reservation to cancellation. The system automatically creates recurring reservations based on course duration.Reservation States
Reservations follow a defined state lifecycle:- reservado: Initial state when a room is booked
- ocupado: Confirmed state when a schedule is generated from the reservation
- cancelado: Final state when a reservation is cancelled
Creating Reservations
Prerequisites
Check Room Availability
First, verify the room is available using the
/aulas-disponibles endpoint.See Room Availability Guide for details.Gather Required Data
Collect all necessary information:
- Course ID
- Room ID (from availability check)
- Teacher ID
- Time slot details
- Student count
API Request
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
asignatura_id | string | Yes | Course identifier |
aula_id | string | Yes | Room identifier |
docente_id | string | Yes | Teacher identifier |
fecha | string | Yes | Start date in DD/MM/YYYY format |
dia | string | Yes | Day of the week |
hora_inicio | string | Yes | Start time (HH:MM) |
hora_fin | string | Yes | End time (HH:MM) |
cantidad_estudiantes | integer | Yes | Number of students |
semestre | integer | Yes | Semester (1-10) |
id_usuario | string | Yes | User making the reservation |
Response Format
Recurring Reservations: The system automatically creates multiple reservations based on the course duration. A 3-month course will create ~13 weekly reservations.
Managing Reservations
List All Reservations
Get Single Reservation
Updating Reservation State
Change State
Update a reservation’s state in the lifecycle:Valid State Transitions
| From | To | Description |
|---|---|---|
| reservado | ocupado | Confirm reservation and generate schedule |
| reservado | cancelado | Cancel before confirmation |
| ocupado | cancelado | Cancel after confirmation |
Cancelling Reservations
Quick Cancel
The DELETE endpoint is a shortcut to cancel a reservation:Common Use Cases
Complete Reservation Workflow
Batch State Updates
Update multiple reservations at once:Query Reservations by Filters
Handle Conflicts
Error Handling
Best Practices
Always Check First
Always check room availability before attempting to create a reservation.
Handle Recurring Dates
Remember that one reservation request creates multiple recurring sessions based on course duration.
State Transitions
Follow proper state transition rules. Never try to revert
ocupado to reservado.Bulk Operations
When updating multiple reservations, implement retry logic and track failures.
Next Steps
Schedule Generation
Learn how to generate schedules from reservations
Room Availability
Check room availability before reserving