Skip to main content
GET
/
users
Get Users
curl --request GET \
  --url https://api.example.com/users
{
  "users": [
    {
      "id": 123,
      "nombre": "<string>",
      "apellidos": "<string>",
      "dni": "<string>",
      "direccion": "<string>",
      "CP": "<string>",
      "provincia": "<string>",
      "localidad": "<string>",
      "pais": "<string>",
      "email": "<string>",
      "telefono": "<string>",
      "fechadealta": "<string>",
      "fechadebaja": "<string>",
      "formadepago": "<string>",
      "cuota": 123,
      "categoria": "<string>",
      "socio": "<string>"
    }
  ]
}

Authentication

This endpoint requires JWT authentication and role-based authorization. Required Guards:
  • JwtAuthGuard - Valid JWT token required
  • RolesGuard - User must have one of the allowed roles
Allowed Roles:
  • monitor
  • admin

Response

Returns an array of all users sorted alphabetically by name.
users
array
required
Array of user objects
id
number
required
Unique user identifier (IdUsuario)
nombre
string
required
User’s first name
apellidos
string
required
User’s last name
dni
string
required
National identification number (DNI)
direccion
string
required
Street address
CP
string
required
Postal code
provincia
string
required
Province
localidad
string
required
City/town (mapped from poblacion)
pais
string
required
Country
email
string
required
User’s email address
telefono
string
required
Phone number
fechadealta
date
required
Registration date (mapped from fechaalta)
fechadebaja
date
Deactivation date (nullable, mapped from fechabaja)
formadepago
string
required
Payment method
cuota
number
required
Membership fee amount
categoria
string
required
User category (e.g., “monitor”, “admin”)
socio
string
required
Membership status - Either “Socio” or “NoSocio”

Example Request

curl -X GET https://api.sociapp.com/users \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "users": [
    {
      "id": 1,
      "nombre": "Ana",
      "apellidos": "García López",
      "dni": "12345678A",
      "direccion": "Calle Mayor 123",
      "CP": "28001",
      "provincia": "Madrid",
      "localidad": "Madrid",
      "pais": "España",
      "email": "[email protected]",
      "telefono": "600123456",
      "fechadealta": "2024-01-15",
      "fechadebaja": null,
      "formadepago": "Transferencia",
      "cuota": 25.00,
      "categoria": "monitor",
      "socio": "Socio"
    },
    {
      "id": 2,
      "nombre": "Carlos",
      "apellidos": "Martínez Ruiz",
      "dni": "87654321B",
      "direccion": "Avenida Principal 45",
      "CP": "08001",
      "provincia": "Barcelona",
      "localidad": "Barcelona",
      "pais": "España",
      "email": "[email protected]",
      "telefono": "611234567",
      "fechadealta": "2024-02-20",
      "fechadebaja": null,
      "formadepago": "Tarjeta",
      "cuota": 30.00,
      "categoria": "socio",
      "socio": "Socio"
    }
  ]
}

Notes

  • Users are automatically sorted alphabetically by nombre (first name)
  • The cuota field is converted to a number, defaulting to 0 if invalid
  • Field names in the response differ from the database entity for better API consistency (e.g., poblacionlocalidad, fechaaltafechadealta)

Build docs developers (and LLMs) love