Skip to main content
POST
/
motorista
Create Driver
curl --request POST \
  --url https://api.example.com/motorista \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "nombre1": "<string>",
  "nombre2": "<string>",
  "nombre3": "<string>",
  "apellido1": "<string>",
  "apellido2": "<string>",
  "apellido3": "<string>",
  "telefono": "<string>",
  "dui": "<string>",
  "nit": "<string>",
  "direccion": "<string>",
  "observaciones": "<string>",
  "idDepartamentoAsignado": 123,
  "idTipoLicencia": 123,
  "numeroLicencia": "<string>",
  "fechaVencimientoLicencia": "<string>",
  "imei": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {}
}

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

POST /motorista

Request Body

email
string
required
Driver’s email address. Must be unique and valid format.
nombre1
string
required
First name (max 100 characters)
nombre2
string
Second name (max 100 characters)
nombre3
string
Third name (max 100 characters)
apellido1
string
required
First surname (max 100 characters)
apellido2
string
Second surname (max 100 characters)
apellido3
string
Married name (max 100 characters)
telefono
string
required
Contact phone number (max 20 characters)
dui
string
required
National ID number. Format: ########-# (8 digits, hyphen, 1 digit). Must be unique.
nit
string
Tax identification number (max 17 characters)
direccion
string
Residential address (max 500 characters)
observaciones
string
Additional observations or notes
idDepartamentoAsignado
integer
required
ID of the assigned department. Must reference an existing department.
idTipoLicencia
integer
required
ID of the license type. Must reference an existing license type.
numeroLicencia
string
required
Driver’s license number (max 50 characters)
fechaVencimientoLicencia
string
required
License expiration date. Format: YYYY-MM-DD
imei
string
Mobile device IMEI (max 100 characters). Must be unique if provided.

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
data
object
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

dui
string
required
National ID number. Format: ########-#. System will query external API for personal data.
email
string
required
Driver’s email address
telefono
string
required
Contact phone number
idDepartamentoAsignado
integer
required
ID of the assigned department
idTipoLicencia
integer
required
ID of the license type
numeroLicencia
string
required
Driver’s license number
fechaVencimientoLicencia
string
required
License expiration date. Format: YYYY-MM-DD
imei
string
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

dui
string
required
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

Build docs developers (and LLMs) love