Complete Driver Creation
Creates a driver with all personal and professional details. This endpoint automatically creates related records (User, Profile, ProfileRole, and DriverProfileDetail) in a single transactional operation.
Endpoint
Request Body
Driver’s email address. Must be unique and valid format.
First name (max 100 characters)
Second name (max 100 characters)
Third name (max 100 characters)
First surname (max 100 characters)
Second surname (max 100 characters)
Married name (max 100 characters)
Contact phone number (max 20 characters)
National ID number. Format: ########-# (8 digits, hyphen, 1 digit). Must be unique.
Tax identification number (max 17 characters)
Residential address (max 500 characters)
Additional observations or notes
ID of the assigned department. Must reference an existing department.
ID of the license type. Must reference an existing license type.
Driver’s license number (max 50 characters)
License expiration date. Format: YYYY-MM-DD
Mobile device IMEI (max 100 characters). Must be unique if provided.
Response
Indicates if the operation was successful
Created driver information including profile ID and all details
Example Request
{
"email": "[email protected]",
"nombre1": "JUAN",
"nombre2": "CARLOS",
"apellido1": "MARTINEZ",
"apellido2": "LOPEZ",
"telefono": "7777-8888",
"dui": "12345678-9",
"direccion": "Col. Escalón, San Salvador",
"idDepartamentoAsignado": 1,
"idTipoLicencia": 1,
"numeroLicencia": "A-12345",
"fechaVencimientoLicencia": "2026-12-31"
}
Example Response
{
"success": true,
"message": "Motorista creado exitosamente",
"data": {
"idPerfil": 123,
"nombreCompleto": "JUAN CARLOS MARTINEZ LOPEZ",
"email": "[email protected]",
"dui": "12345678-9"
}
}
Status Codes
201: Driver created successfully
400: Validation error (invalid format)
409: Conflict (duplicate email, DUI, or IMEI)
500: Internal server error
Simplified Creation via DUI
Creates a driver by querying the external DUI database to automatically populate personal information (names, surnames, and address).
Endpoint
POST /motorista/crear-por-dui
Request Body
National ID number. Format: ########-#. System will query external API for personal data.
ID of the assigned department
License expiration date. Format: YYYY-MM-DD
Mobile device IMEI (optional)
Response
Same structure as complete creation endpoint.
Example Request
{
"dui": "12345678-9",
"email": "[email protected]",
"telefono": "7777-8888",
"idDepartamentoAsignado": 1,
"idTipoLicencia": 1,
"numeroLicencia": "A-12345",
"fechaVencimientoLicencia": "2026-12-31"
}
Status Codes
201: Driver created successfully
400: Validation error
404: DUI not found in external database
409: Conflict (duplicate email or DUI)
500: Internal server error
502/503: External DUI service unavailable
DUI Lookup
Query the external DUI database to retrieve citizen information before creating a driver.
Endpoint
GET /motorista/consulta-dui/{dui}
Path Parameters
National ID number to query. Format: ########-#
Response
Returns personal information from the national registry:
- Names and surnames
- Date of birth
- Address
- Gender
- Profession
- Residence
Note: Does not include signature or photo (base64 fields excluded for performance).
Status Codes
200: Data retrieved successfully
404: DUI not found
500: Internal server error
502/503: External service unavailable