The professors resource (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.
/api/profesores) exposes CRUD operations for professor profiles. A professor profile is always linked to an existing user account; when you create a professor record the referenced user’s role is automatically updated to profesor. Profiles include the professor’s department and their associated cubicle assignments. Read operations are public; write operations require admin authentication.
List all professors
GET /api/profesores
Returns all professor profiles with their linked user information and cubicle assignments.
Response
Professor profile ID.
Linked user account ID.
Department the professor belongs to.
Whether the professor profile is active.
Example
Get a professor by ID
GET /api/profesores/:id
Returns a single professor profile with linked user data, cubicle assignments, and full building details for each cubicle.
Path parameters
The
id_profesor of the professor to retrieve.Response
Returns the professor object. Returns404 with { "error": "Profesor no encontrado" } if no professor with the given ID exists.
Example
Create a professor
POST /api/profesores
Creates a professor profile for an existing user. Requires admin authentication.
Creating a professor profile automatically updates the referenced user’s
rol field to "profesor". Make sure the id_usuario refers to an existing user account before calling this endpoint.Request body
ID of the existing user account to link. Their role will be set to
profesor as a side effect.Department the professor belongs to (e.g.,
"Ingeniería de Software").Optional cubicle to assign to this professor. The cubicle record’s
id_profesor field is updated to point to the new professor.Set to
false to create the profile in an inactive state.Response
Returns the created professor profile with user info and cubicle assignments, and HTTP201 Created.
Example
Update a professor
PUT /api/profesores/:id
Updates an existing professor profile. Requires admin authentication.
Path parameters
The
id_profesor of the professor to update.Request body
All fields are optional.Department name.
Active status of the professor profile.
Assign a new cubicle to this professor. The cubicle record is updated accordingly.
Response
Returns the updated professor with user info and cubicle assignments.Example
Delete a professor
DELETE /api/profesores/:id
Permanently deletes a professor profile. The linked user account is not deleted. Requires admin authentication.
Path parameters
The
id_profesor of the professor to delete.