Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sheeplettuce/Monitor/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve every expediente stored in Monitor API. The response is a summary array ordered by fecha_ingreso descending — it omits heavy nested relations to keep list payloads small. All authenticated roles (Administrador, Operador, Técnico) can call this endpoint.

Endpoint

GET /api/expedientes
Authentication: Bearer token required (any role).
Técnico-role users have read-only access. They may call this endpoint but cannot create, update, or delete records.

Request

No path parameters, query parameters, or request body.
curl http://localhost:3000/api/expedientes \
  -H "Authorization: Bearer $TOKEN"

Response — 200 OK

Returns a JSON array of summary expediente objects. Each element contains the fields below.
[].no_siniestro
string
Primary key. The unique claim (siniestro) number assigned to this expediente (e.g. "SIN-2024-001").
[].factura
string | null
Invoice number associated with the repair order.
[].orden
string | null
Internal work-order number.
[].asesor
string | null
Name of the service advisor handling this claim.
[].fecha_ingreso
string (ISO date) | null
Date the vehicle was received. Stored as a Date (no time component). Example: "2024-03-15T12:00:00.000Z".
[].estado
string (estado_enum)
Current workflow status. One of:
ValueMeaning
IngresoVehicle has just been received
RestauracionActive repair / restoration
Pendiente_de_salidaRepair complete, awaiting release
SalidaVehicle has been returned to owner
[].marca
string | null
Vehicle make (e.g. "Toyota").
[].modelo
string | null
Vehicle model (e.g. "Corolla").
[].tipo
string | null
Vehicle body type or trim level (e.g. "Sedán", "SUV").
[].color
string | null
Vehicle color (e.g. "Blanco").
[].placas
string | null
License plate number.
[].nombre_cliente
string | null
Full name of the vehicle owner / policyholder.
[].telefono_cliente
string | null
Client contact phone number.
[].aseguradora
object | null
Condensed insurer record. null when no insurer is linked.

Example response body

[
  {
    "no_siniestro": "SIN-2024-001",
    "factura": "F-00123",
    "orden": "OT-2024-045",
    "asesor": "María López",
    "fecha_ingreso": "2024-03-15T12:00:00.000Z",
    "estado": "Restauracion",
    "marca": "Toyota",
    "modelo": "Corolla",
    "tipo": "Sedán",
    "color": "Blanco",
    "placas": "ABC-123",
    "nombre_cliente": "Juan García",
    "telefono_cliente": "555-100-2000",
    "aseguradora": {
      "id": 1,
      "nombre": "GNP Seguros"
    }
  }
]

Error responses

StatusBodyCause
401{ "error": "Token requerido" }Missing or malformed Authorization header
401{ "error": "Token inválido o expirado" }JWT verification failed
500{ "error": "Error al obtener la lista de expedientes" }Database or internal error

GET /api/expedientes/aseguradoras
Returns the catalogue of insurance companies for use in create / filter UIs. Requires the same Bearer token.
This route is registered before /:no_siniestro in the router so Express never interprets the literal string aseguradoras as a siniestro number.
curl http://localhost:3000/api/expedientes/aseguradoras \
  -H "Authorization: Bearer $TOKEN"

Response — 200 OK

Returns a JSON array ordered alphabetically by nombre.
[].id
integer
Auto-incremented primary key of the insurer.
[].nombre
string | null
Display name of the insurance company.
[
  { "id": 3, "nombre": "AXA Seguros" },
  { "id": 1, "nombre": "GNP Seguros" },
  { "id": 2, "nombre": "Qualitas" }
]
StatusBodyCause
401{ "error": "Token requerido" }Missing or malformed Authorization header
500{ "error": "Error al obtener la lista de aseguradoras" }Database or internal error

Build docs developers (and LLMs) love