Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Nyverie/reservafacil/llms.txt

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

The GET /api/usuarios endpoint returns the complete list of registered users in the platform, along with each user’s role, account status, and a count of their total reservations. This endpoint is exclusively available to superadmins and is intended for user management dashboards and administrative tooling.

GET /api/usuarios

Returns all Usuario records ordered by registration date descending (most recently created first). Each record includes a computed _count.reservas field reflecting the total number of reservations associated with that user. Requires SUPERADMIN role. Requests from users with ADMIN or USUARIO roles — or unauthenticated requests — are rejected immediately with 403.
Password hashes are never included in the response. The query uses an explicit select block that omits the password field entirely.

Response 200

{
  "usuarios": [
    {
      "id": "clx9usr1abc2def",
      "nombre": "Ana López",
      "email": "ana@example.com",
      "rol": "USUARIO",
      "activo": true,
      "creadoEn": "2024-01-01T09:00:00.000Z",
      "_count": {
        "reservas": 5
      }
    },
    {
      "id": "clx9usr2ghi3jkl",
      "nombre": "Carlos Ruiz",
      "email": "carlos@example.com",
      "rol": "ADMIN",
      "activo": false,
      "creadoEn": "2023-12-15T14:30:00.000Z",
      "_count": {
        "reservas": 12
      }
    }
  ]
}
usuarios
Usuario[]
required
Array of user objects ordered by creadoEn descending.
usuarios[].id
string
CUID identifier for the user record.
usuarios[].nombre
string
Full display name of the user.
usuarios[].email
string
Unique email address. Used for login and as a human-readable identifier.
usuarios[].rol
enum
Role assigned to the user. One of: USUARIO, ADMIN, SUPERADMIN.
usuarios[].activo
boolean
Whether the account is currently active. Inactive accounts (false) cannot log in.
usuarios[].creadoEn
string (ISO 8601)
Timestamp of when the account was created. The list is sorted by this field, descending.
usuarios[]._count.reservas
number
Total number of reservations created by this user across all statuses and dates.

Error responses

StatusBodyDescription
403{ "error": "Sin permisos" }Caller is not authenticated or does not have SUPERADMIN role.

Examples

curl https://your-domain.com/api/usuarios \
  --cookie "token=<your_jwt_token>"

Build docs developers (and LLMs) love