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.

Update one or more fields on an existing expediente. Send only the fields you want to change — omitted fields are left exactly as they are. All date and timestamp fields are re-parsed server-side, so you can safely send a "YYYY-MM-DD" string even on an update.
The estado field cannot be changed through this endpoint. Any estado value sent in the request body is silently stripped before the update is applied. Status transitions are managed by a dedicated workflow module.

Endpoint

PUT /api/expedientes/:no_siniestro
Authentication: Bearer token required. Role: Administrador or Operador only.

Path parameter

no_siniestro
string
required
The unique claim number of the expediente to update (e.g. SIN-2024-001). Returns 400 if the segment is missing.

Request body

Send any subset of the fields below. All fields are optional — at minimum one field should be included for the request to be meaningful.

Vehicle fields

marca
string
Vehicle make.
modelo
string
Vehicle model.
tipo
string
Body type or trim level.
color
string
Vehicle color.
placas
string
License plate number.
vehiculo
string
Free-text vehicle description.

Client fields

nombre_cliente
string
Full name of the policyholder / vehicle owner.
telefono_cliente
string
Client contact phone number.
correo_cliente
string
Client email address.

Administrative fields

factura
string
Invoice number for the repair.
orden
string
Internal work-order reference.
asesor
string
Service advisor’s name.
tecnico
string
Body technician assigned to this unit.
mecanico
string
Mechanic assigned to this unit.
observaciones
string
General notes or observations about the repair.
id_aseguradora
integer
Reassign the expediente to a different insurer by providing a new FK.

Date fields

All date fields accept "YYYY-MM-DD" strings. The server parses them at 12:00:00 to avoid UTC day-shift.
fecha_ingreso
string
Date the vehicle entered the shop. Format: "YYYY-MM-DD".
fecha_valuacion
string
Date the damage estimate was completed. Format: "YYYY-MM-DD".
fecha_autorizacion
string
Date the insurer authorized the repair. Format: "YYYY-MM-DD".
fecha_pzas_completas
string
Date all replacement parts arrived. Format: "YYYY-MM-DD".
unidad_terminada
string
Date the vehicle repair was finished. Format: "YYYY-MM-DD".

Insurer-communication fields

comentarios_aseguradora
string
Updated notes from or for the insurer.
comentarios_aseguradora_fh
string
ISO 8601 timestamp of the latest insurer comment. Example: "2024-03-20T10:30:00.000Z".

Custom dato fields

dato1
string
Custom tracking label slot 1 (up to 500 chars).
dato1_fecha_hora
string
ISO 8601 timestamp for dato1.
dato2
string
Custom tracking label slot 2.
dato2_fecha_hora
string
ISO 8601 timestamp for dato2.
dato3
string
Custom tracking label slot 3.
dato3_fecha_hora
string
ISO 8601 timestamp for dato3.
dato4
string
Custom tracking label slot 4.
dato4_fecha_hora
string
ISO 8601 timestamp for dato4.

Document checklist flags

doc_orden_admision
boolean
Admission work order received.
doc_identificacion
boolean
Client government-issued ID received.
doc_tarjeta_circulacion
boolean
Vehicle registration card received.
doc_caratula_poliza
boolean
Insurance policy cover page received.
doc_carta_reparacion
boolean
Repair authorization letter received.
doc_comprobante_deducible
boolean
Deductible payment receipt received.
doc_finiquito
boolean
Final settlement document received.
doc_encuesta_servicio
boolean
Customer satisfaction survey completed.

Request example

Assign a technician and mark that the replacement parts have arrived:
curl -X PUT http://localhost:3000/api/expedientes/SIN-2024-001 \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tecnico": "Carlos Pérez",
    "fecha_pzas_completas": "2024-03-22"
  }'

Response — 200 OK

Returns the complete updated expediente as persisted (flat scalar fields, no nested relations).
no_siniestro
string
Unchanged primary key.
estado
string
The current workflow status, unchanged by this call.
All response fields follow the same schema as GET /api/expedientes/:no_siniestro. Refer to that page for the complete field reference.

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",
  "fecha_valuacion": "2024-03-18T12:00:00.000Z",
  "fecha_autorizacion": "2024-03-20T12:00:00.000Z",
  "fecha_pzas_completas": "2024-03-22T12:00:00.000Z",
  "unidad_terminada": null,
  "tecnico": "Carlos Pérez",
  "mecanico": null,
  "vehiculo": null,
  "observaciones": "Daño lateral derecho severo.",
  "marca": "Toyota",
  "modelo": "Corolla",
  "tipo": "Sedán",
  "color": "Blanco",
  "placas": "ABC-123",
  "nombre_cliente": "Juan García",
  "telefono_cliente": "555-100-2000",
  "correo_cliente": "juan@example.com",
  "dato1": null,
  "dato1_fecha_hora": null,
  "dato2": null,
  "dato2_fecha_hora": null,
  "dato3": null,
  "dato3_fecha_hora": null,
  "dato4": null,
  "dato4_fecha_hora": null,
  "comentarios_aseguradora": null,
  "comentarios_aseguradora_fh": null,
  "doc_orden_admision": true,
  "doc_identificacion": true,
  "doc_tarjeta_circulacion": true,
  "doc_caratula_poliza": false,
  "doc_carta_reparacion": false,
  "doc_comprobante_deducible": null,
  "doc_finiquito": null,
  "doc_encuesta_servicio": null,
  "estado": "Restauracion",
  "ubicacion_almacenamiento": "Local",
  "id_aseguradora": 1,
  "creado_por": 2
}

Error responses

StatusBodyCause
400{ "error": "No. Siniestro requerido" }The :no_siniestro path segment is missing
401{ "error": "Token requerido" }No Authorization header provided
401{ "error": "Token inválido o expirado" }JWT verification failed
403{ "error": "Acceso restringido a administradores y operadores" }Authenticated user has Técnico role
404{ "error": "Expediente no encontrado" }No record with that no_siniestro exists
500{ "error": "Error interno al actualizar expediente" }Database or internal server error

Build docs developers (and LLMs) love