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 dashboard endpoint gives administrators a bird’s-eye view of the platform by returning totals and active-state counts for every major entity in a single round trip. Use it to populate summary widgets or health indicators in an admin panel without querying each resource endpoint individually.
This endpoint requires an admin role. Requests made with a non-admin token or without any token will be rejected with 401 or 403.

GET /api/analytics/dashboard

Request headers

Authorization
string
required
Bearer token obtained from the authentication flow. The token must belong to a user with the admin role.

Response — 200 OK

usuarios
object
Counts for registered users.
edificios
object
Counts for campus buildings.
salones
number
Total number of classrooms across all buildings.
profesores
number
Total number of professor records.
cubiculos
number
Total number of office cubicles across all buildings.
eventos
object
Counts for campus events.
rutas
object
Counts for navigation routes.
totalAccesos
number
Total login access log entries recorded across all users.

Example

curl --request GET \
  --url https://your-domain/api/analytics/dashboard \
  --header 'Authorization: Bearer <token>'
{
  "usuarios": { "total": 42, "activos": 38, "pendientes": 4 },
  "edificios": { "total": 12, "activos": 12 },
  "salones": 87,
  "profesores": 15,
  "cubiculos": 30,
  "eventos": { "total": 25, "activos": 18 },
  "rutas": { "total": 140, "activas": 138 },
  "totalAccesos": 1204
}

Error responses

StatusBodyCause
401{ "error": "No autorizado" }Missing or invalid Bearer token.
403{ "error": "Acceso denegado. Se requieren permisos de administrador" }Token belongs to a non-admin user.
500{ "error": "Error interno" }Unexpected server-side error.

Build docs developers (and LLMs) love