Skip to main content

Catalog Management API

The Catalog Management API provides endpoints to manage various catalogs used throughout the transportation request system. All catalogs follow a consistent CRUD pattern with soft deletion, validation, and standardized Spanish responses.

Available Catalogs

Request & Mission Catalogs

Vehicle Catalogs

Driver Catalogs

Common Features

All catalog endpoints share these characteristics:

CRUD Operations

  • POST / - Create new catalog entry
  • GET / - Retrieve single entry by ID
  • GET / - List entries with pagination and filters
  • GET /todos/lista - List all active entries (no pagination, ideal for dropdowns)
  • PUT / - Update existing entry
  • DELETE / - Soft delete entry

Validation Rules

  • Unique constraints - Code and name fields must be unique across active records
  • Code formatting - Codes are uppercase, no spaces allowed
  • Soft deletion - Records are marked inactive rather than physically deleted
  • Referential integrity - Cannot delete entries referenced by active records

Response Format

All endpoints return standardized responses:
{
  "success": true,
  "message": "Operación exitosa",
  "data": { ... }
}

Error Handling

  • 400 - Bad request (validation errors)
  • 404 - Not found
  • 409 - Conflict (duplicate code/name)
  • 500 - Internal server error

Filter Capabilities

Most catalog endpoints support:
  • codigo - Partial match on code field
  • nombre - Partial match on name field
  • busqueda - General search across multiple fields
  • Catalog-specific filters (e.g., esEstadoFinal, permiteAsignacion)

Pagination

Paginated endpoints accept:
  • pagina - Page number (min: 1)
  • por_pagina - Records per page (min: 1, max: 100)
Response includes:
{
  "items": [...],
  "total": 50,
  "pagina": 1,
  "porPagina": 10,
  "totalPaginas": 5
}

Build docs developers (and LLMs) love