Skip to main content
GET
/
motorista
List Drivers
curl --request GET \
  --url https://api.example.com/motorista
{
  "success": true,
  "message": "<string>",
  "data": [
    {}
  ]
}

Paginated Driver List

Retrieves a paginated list of active drivers with support for multiple filters.

Endpoint

GET /motorista

Query Parameters

pagina
integer
default:"1"
Page number (minimum: 1)
por_pagina
integer
default:"10"
Records per page (minimum: 1, maximum: 100)
nombre
string
Filter by full name (partial match)
dui
string
Filter by DUI number (partial match)
idDepartamento
integer
Filter by department ID (exact match)
idDisponibilidad
integer
Filter by availability status ID (exact match)
busqueda
string
General search across name, DUI, email, and phone number

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
data
object
Pagination information and driver records

Example Request

GET /motorista?pagina=1&por_pagina=10&idDepartamento=1&busqueda=MARTINEZ

Example Response

{
  "success": true,
  "message": "Listado de motoristas obtenido exitosamente",
  "data": {
    "registros": [
      {
        "idPerfil": 123,
        "nombreCompleto": "JUAN CARLOS MARTINEZ LOPEZ",
        "email": "[email protected]",
        "telefono": "7777-8888",
        "dui": "12345678-9",
        "departamento": "San Salvador",
        "disponibilidad": "Disponible",
        "numeroLicencia": "A-12345",
        "vencimientoLicencia": "2026-12-31"
      }
    ],
    "pagina": 1,
    "porPagina": 10,
    "total": 1,
    "totalPaginas": 1
  }
}

Status Codes

  • 200: List retrieved successfully
  • 500: Internal server error

Complete Driver List (Non-Paginated)

Retrieves all active drivers without pagination. Useful for populating dropdowns and select components.

Endpoint

GET /motorista/todos/lista

Query Parameters

nombre
string
Filter by full name (partial match)
dui
string
Filter by DUI number (partial match)
idDepartamento
integer
Filter by department ID (exact match)
idDisponibilidad
integer
Filter by availability status ID (exact match)
busqueda
string
General search across multiple fields

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
data
array
Array of all active driver records matching the filters

Example Request

GET /motorista/todos/lista?idDisponibilidad=1

Example Response

{
  "success": true,
  "message": "Listado completo de motoristas obtenido exitosamente",
  "data": [
    {
      "idPerfil": 123,
      "nombreCompleto": "JUAN CARLOS MARTINEZ LOPEZ",
      "dui": "12345678-9",
      "disponibilidad": "Disponible"
    },
    {
      "idPerfil": 124,
      "nombreCompleto": "MARIA ELENA RODRIGUEZ GARCIA",
      "dui": "98765432-1",
      "disponibilidad": "Disponible"
    }
  ]
}

Status Codes

  • 200: List retrieved successfully
  • 500: Internal server error

Filter Combinations

You can combine multiple filters to narrow down results:
# By department and availability
GET /motorista?idDepartamento=1&idDisponibilidad=2

# By name and DUI
GET /motorista?nombre=MARTINEZ&dui=12345

# General search with pagination
GET /motorista?busqueda=7777&pagina=1&por_pagina=20

Use Cases

  • Paginated endpoint: Use for main driver listing pages with navigation
  • Complete list endpoint: Use for dropdown menus, autocomplete fields, and multi-select components
  • Filters: Apply specific filters to find drivers by department, availability, or search terms

Build docs developers (and LLMs) love