Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luiss811/Backend-Airguide/llms.txt

Use this file to discover all available pages before exploring further.

The salones (rooms) resource lets you list all rooms across campus, list rooms within a specific building, and create, update, or delete individual room records. Rooms are typed as aula (regular classroom), laboratorio (laboratory), or auditorio (auditorium). Read operations are public; write operations require admin authentication.
POST, PUT, and DELETE requests require a valid Bearer token from an account with the admin role.

TipoSalon enum values

ValueMeaning
aulaStandard classroom used for lectures and seminars.
laboratorioLaboratory equipped for practical or computer-based work.
auditorioLarge auditorium for presentations and events.

List all rooms


GET /api/edificios/salones Returns every room in the system, ordered by building then by floor. Each room object includes summary information about its parent building.

Response

id_salon
integer
Room ID.
id_edificio
integer
Parent building ID.
nombre
string
Room name or label.
piso
integer
Floor number where the room is located.
tipo
string
Room type: aula, laboratorio, or auditorio.
activo
boolean
Whether the room is active.
edificio
object

Example

curl https://api.example.com/api/edificios/salones
[
  {
    "id_salon": 1,
    "id_edificio": 2,
    "nombre": "Lab 301",
    "piso": 3,
    "tipo": "laboratorio",
    "activo": true,
    "edificio": {
      "id_edificio": 2,
      "nombre": "Edificio B",
      "tipo": "academico"
    }
  }
]

List rooms by building


GET /api/edificios/:id/salones Returns all rooms belonging to a specific building, ordered by floor.

Path parameters

id
integer
required
The id_edificio of the building whose rooms you want to retrieve.

Response

Returns an array of room objects (without the nested edificio field). Returns an empty array if the building has no rooms.

Example

curl https://api.example.com/api/edificios/2/salones
[
  {
    "id_salon": 1,
    "id_edificio": 2,
    "nombre": "Aula 101",
    "piso": 1,
    "tipo": "aula",
    "activo": true
  },
  {
    "id_salon": 2,
    "id_edificio": 2,
    "nombre": "Lab 301",
    "piso": 3,
    "tipo": "laboratorio",
    "activo": true
  }
]

Create a room


POST /api/edificios/:id/salones Creates a new room inside the specified building. Returns 404 if the building does not exist. Requires admin authentication.

Path parameters

id
integer
required
The id_edificio of the building the room belongs to.

Request body

nombre
string
required
Room name or label (e.g., "Aula 202", "Lab de Redes").
piso
integer
required
Floor number where the room is located. Use 0 for ground floor.
tipo
string
required
Room type. One of: aula, laboratorio, auditorio.
activo
boolean
default:"true"
Set to false to create the room in an inactive state.

Response

Returns the created room with its parent building summary and HTTP 201 Created. Returns 404 with { "error": "Edificio no encontrado" } if the building ID is invalid.

Example

curl -X POST https://api.example.com/api/edificios/2/salones \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Auditorio Central",
    "piso": 1,
    "tipo": "auditorio",
    "activo": true
  }'
{
  "id_salon": 8,
  "id_edificio": 2,
  "nombre": "Auditorio Central",
  "piso": 1,
  "tipo": "auditorio",
  "activo": true,
  "edificio": {
    "id_edificio": 2,
    "nombre": "Edificio B",
    "tipo": "academico"
  }
}

Update a room


PUT /api/edificios/salones/:id Updates an existing room. Send only the fields you want to change. Requires admin authentication.

Path parameters

id
integer
required
The id_salon of the room to update.

Request body

All fields are optional for partial updates.
nombre
string
Room name.
piso
integer
Floor number.
tipo
string
Room type: aula, laboratorio, or auditorio.
activo
boolean
Active status.

Response

Returns the updated room with its parent building summary.

Example

curl -X PUT https://api.example.com/api/edificios/salones/8 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Auditorio Norte",
    "activo": false
  }'
{
  "id_salon": 8,
  "id_edificio": 2,
  "nombre": "Auditorio Norte",
  "piso": 1,
  "tipo": "auditorio",
  "activo": false,
  "edificio": {
    "id_edificio": 2,
    "nombre": "Edificio B",
    "tipo": "academico"
  }
}

Delete a room


DELETE /api/edificios/salones/:id Permanently deletes a room record. Requires admin authentication.

Path parameters

id
integer
required
The id_salon of the room to delete.

Response

{
  "message": "Salón eliminado"
}

Example

curl -X DELETE https://api.example.com/api/edificios/salones/8 \
  -H "Authorization: Bearer <token>"

Build docs developers (and LLMs) love