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.

Permanently remove an expediente record from Monitor API. This action is irreversible and is restricted exclusively to users with the Administrador role. The delete is wrapped in a database transaction so that all related records are removed atomically — either everything is deleted or nothing is.
Deleting an expediente removes all of its child records within the same transaction. The following tables are purged in order before the expediente itself is removed:
  1. checklist_item — individual checklist line items
  2. checklist — inspection checklist records
  3. levantamiento_concepto — damage-survey line items
  4. levantamiento_danios — damage-survey records
  5. evidencia — file metadata records (physical files on disk or cloud are not deleted by this call)
  6. historial_estado — full status-change audit history
Because the foreign keys are defined with onDelete: NoAction, attempting to delete the expediente without first removing these children would fail at the database level. The service handles this automatically via a wrapped $transaction. This operation cannot be undone.

Endpoint

DELETE /api/expedientes/:no_siniestro
Authentication: Bearer token required. Role: Administrador only.

Path parameter

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

Request

No query parameters or request body.
curl -X DELETE http://localhost:3000/api/expedientes/SIN-2024-001 \
  -H "Authorization: Bearer $ADMIN_TOKEN"

Response — 200 OK

Returns a confirmation object. Note that this is 200, not 204 — a body is included so clients can confirm which record was removed.
ok
boolean
Always true when the deletion succeeded.
no_siniestro
string
The siniestro number that was deleted, echoed back for confirmation.

Example response body

{
  "ok": true,
  "no_siniestro": "SIN-2024-001"
}

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" }Authenticated user is not an Administrador
404{ "error": "Expediente no encontrado" }No record with that no_siniestro exists
500{ "error": "Error interno al eliminar expediente" }Database or internal server error — the transaction was rolled back; no data was changed

Build docs developers (and LLMs) love