Skip to main content
GET
/
api
/
v1
/
users
/
:id
Get User
curl --request GET \
  --url https://api.example.com/api/v1/users/:id
{
  "success": true,
  "data": {
    "id": "770e8400-e29b-41d4-a716-446655440000",
    "name": "Juan Pérez",
    "username": "jperez",
    "email": "[email protected]",
    "phone": "8091234567",
    "role": "VENDEDOR",
    "ventanaId": "660e8400-e29b-41d4-a716-446655440000",
    "code": "V001",
    "isActive": true,
    "settings": {
      "print": {
        "name": "Mobile Printer",
        "phone": "8091234567",
        "width": 58,
        "footer": "Gracias por su compra",
        "barcode": true,
        "bluetoothMacAddress": "12:34:56:78:90:AB"
      },
      "theme": "dark",
      "system": {
        "notifications": true,
        "language": "es"
      }
    },
    "platform": "android",
    "appVersion": "2.0.7",
    "deletedAt": null,
    "deletedBy": null,
    "deletedReason": null,
    "createdAt": "2024-03-15T12:00:00Z",
    "updatedAt": "2024-03-15T14:30:00Z"
  }
}

Overview

Retrieves detailed information about a specific user. Users can view their own profile, ADMIN can view any user, and VENTANA users can view their vendedores.

Authorization

Required: ADMIN, self, or VENTANA (for vendedores in their ventana)
Permissions enforced by restrictToAdminSelfOrVentanaVendor middleware.

Path Parameters

id
string
required
UUID of the user to retrieve

Response

success
boolean
Indicates if the request was successful
data
object
The user object (password excluded)
{
  "success": true,
  "data": {
    "id": "770e8400-e29b-41d4-a716-446655440000",
    "name": "Juan Pérez",
    "username": "jperez",
    "email": "[email protected]",
    "phone": "8091234567",
    "role": "VENDEDOR",
    "ventanaId": "660e8400-e29b-41d4-a716-446655440000",
    "code": "V001",
    "isActive": true,
    "settings": {
      "print": {
        "name": "Mobile Printer",
        "phone": "8091234567",
        "width": 58,
        "footer": "Gracias por su compra",
        "barcode": true,
        "bluetoothMacAddress": "12:34:56:78:90:AB"
      },
      "theme": "dark",
      "system": {
        "notifications": true,
        "language": "es"
      }
    },
    "platform": "android",
    "appVersion": "2.0.7",
    "deletedAt": null,
    "deletedBy": null,
    "deletedReason": null,
    "createdAt": "2024-03-15T12:00:00Z",
    "updatedAt": "2024-03-15T14:30:00Z"
  }
}

Notes

  • Password is never included in response
  • ID must be a valid UUID format
  • Settings object includes print config, theme, and system preferences (see src/api/v1/validators/user.validator.ts:61-67)
  • Middleware ensures VENTANA users can only access their vendedores (see src/api/v1/routes/user.routes.ts:78-82)
  • Returns 404 if user is soft-deleted
  • Implementation: src/api/v1/controllers/user.controller.ts:43-45

Build docs developers (and LLMs) love