These endpoints allow administrators to manage the AirGuide user base. They cover listing all registered users, filtering by pending approval status, and updating an account’sDocumentation 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.
estado. Every endpoint on this page enforces the admin role — requests from profesor, alumno, or unauthenticated clients are rejected.
GET /api/auth/users
Returns every user account in the system, ordered by registration date descending. Authentication required:Authorization: Bearer <token> (admin only)
Response — 200 OK
An array of user objects.Internal numeric user identifier.
User’s email address.
User’s full name.
Student ID number, or empty string if not set.
Role assigned to the account:
rector, admin, profesor, or alumno.Account status:
activo, pendiente, or rechazado.ISO 8601 timestamp of account creation.
ISO 8601 timestamp of last admin validation. May be
null.Example
GET /api/auth/pending
Returns only accounts withestado = "pendiente", ordered by registration date descending. Use this endpoint to build an admin approval queue.
Authentication required: Authorization: Bearer <token> (admin only)
Response — 200 OK
An array of pending user objects. Fields are identical to the user list above, exceptfecha_validacion is not included (pending accounts have not been validated yet).
Internal numeric user identifier.
User’s email address.
User’s full name.
Student ID number, or empty string if not set.
Role assigned to the account.
Always
"pendiente" for results from this endpoint.ISO 8601 timestamp of account creation.
Example
PUT /api/auth/validate/:id
Approves or rejects a user account by updating itsestado. Also sets fecha_validacion to the current timestamp.
Authentication required: Authorization: Bearer <token> (admin only)
Path parameter
The
id_usuario of the account to update.Request body
The new account status. Must be either
"activo" (approve) or "rechazado" (reject). Any other value returns a 400 error.Response — 200 OK
The full updated user object as stored in the database, including all fields.Error responses
| Status | Body | Cause |
|---|---|---|
400 | { "error": "Estado inválido" } | estado was not "activo" or "rechazado". |
