POST /api/v1/auth/login
Authenticates a user with their credentials and returns JWT access and refresh tokens for subsequent API requests.Request Body
The user’s username (must start with a letter, followed by letters, digits, dots, or dashes)
The user’s password (minimum 6 characters, maximum 100 characters)
The platform from which the user is logging inOptions:
web, android, iosThe version of the application (maximum 50 characters)Example:
2.0.7A persistent UUID generated by the client to identify the device (maximum 255 characters)When provided, any previous tokens from this device will be automatically revoked.
A human-readable name for the device (maximum 255 characters)Examples:
Chrome · Windows, Samsung Galaxy S23Response
Indicates if the request was successful
JWT access token for authenticating API requestsInclude this token in the
Authorization header as Bearer <accessToken>JWT refresh token for obtaining new access tokens when they expireStore securely and use with the
/api/v1/auth/refresh endpointThe user’s unique identifier (UUID)
The user’s username
The user’s email address (optional)
The user’s role in the systemOptions:
ADMIN, VENTANA, VENDEDORThe ID of the ventana (window) associated with the user (null for ADMIN users)
Error Responses
401 Unauthorized
Invalid credentials provided
403 Forbidden
User account is inactive
400 Bad Request
Validation error in request body
Notes
- All login attempts are logged for security auditing purposes
- If you provide a
deviceId, any existing tokens for that device will be automatically revoked to maintain a single active session per device - The access token contains the user’s ID, role, ventanaId, and bancaId in its payload
- Failed login attempts (wrong credentials, inactive account) are logged with detailed context including IP address and user agent
- The IP address is extracted from the
X-Forwarded-Forheader if present, otherwise from the request socket