Skip to main content
Retrieves a list of all users in the system.

Endpoint

GET /users

Authentication

This endpoint requires JWT authentication and Admin role.
Authorization: Bearer YOUR_JWT_TOKEN

Response

Returns an array of user objects.
id
number
Unique identifier for the user
nombre
string
Full name of the user
rol
string
User role (Admin, Psicologo, TrabajoSocial, Guia)
nomUsuario
string
Username
estatus
boolean
User active status
creadoEn
string
Timestamp when user was created

Example Request

curl -X GET http://localhost:3000/users \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

[
  {
    "id": 1,
    "nombre": "Administrator",
    "rol": "Admin",
    "nomUsuario": "admin",
    "estatus": true,
    "creadoEn": "2026-03-01T08:00:00.000Z"
  },
  {
    "id": 2,
    "nombre": "María García",
    "rol": "Psicologo",
    "nomUsuario": "mgarcia",
    "estatus": true,
    "creadoEn": "2026-03-02T09:15:00.000Z"
  },
  {
    "id": 3,
    "nombre": "Carlos López",
    "rol": "TrabajoSocial",
    "nomUsuario": "clopez",
    "estatus": true,
    "creadoEn": "2026-03-03T10:30:00.000Z"
  }
]
Only users with Admin role can access this endpoint.

Build docs developers (and LLMs) love