New accounts are not immediately active. After a successful registration the accountDocumentation 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 is set to pendiente, and an administrator must approve it before the user can complete the login flow. This page also documents GET /api/auth/me, which returns the profile of the currently authenticated user.
POST /api/auth/register
Creates a new user record with thealumno role. Both correo and matricula must be unique across all existing accounts.
Request body
Email address for the new account. Must not already be registered.
Password for the account. Stored as a bcrypt hash; never persisted in plain text.
Full name of the user.
Student ID number. Optional, but must be unique if provided. Defaults to an empty string when omitted.
Response — 201 Created
Confirmation string:
"Registro exitoso. Tu cuenta está pendiente de validación por un administrador."The newly created user record.
Error responses
| Status | Body | Cause |
|---|---|---|
400 | { "error": "El correo ya está registrado" } | An account with the same correo already exists. |
400 | { "error": "La matrícula ya está registrada" } | An account with the same matricula already exists. |
400 | { "error": "<validation message>" } | Zod schema validation failed (e.g. missing required field). |
After registration, the user cannot log in until an administrator changes the account
estado to activo using PUT /api/auth/validate/:id. Direct the user to contact their institution’s administrator to request approval.Example
GET /api/auth/me
Returns the full profile of the currently authenticated user. Use this endpoint to retrieve up-to-date account details after login or to verify the token is still valid. Authentication required:Authorization: Bearer <token>
Response — 200 OK
Internal numeric user identifier.
User’s registered 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.Current account status:
activo, pendiente, or rechazado.ISO 8601 timestamp of when the account was created.
ISO 8601 timestamp of when the account was last validated by an administrator. May be
null if not yet validated.