Monitor API provides two evidence deletion endpoints: one to delete a single file record by ID, and one to remove the entire evidence folder for an expediente (typically used when rolling back a claim creation). Both endpoints require authentication; role requirements differ between them.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.
Delete a Single Evidence File
Administrador role may call this endpoint.
Deletes the evidence record from the database and removes the physical file from disk. If the stored ruta path exists on the filesystem, the file is deleted with fs.unlinkSync before the database record is removed.
Physical file deletion is a best-effort operation — if the file is already missing from disk, the deletion proceeds and the database record is still removed without error.
Path Parameters
The siniestro number of the parent expediente (e.g.
SIN-2024-001).Numeric ID of the evidencia record to delete. Returns
400 if the value cannot be parsed as an integer, and 404 if no record with that ID exists.Example Request
Response
200 — Success
Returns a confirmation object when the record has been deleted.Always
true on successful deletion.Error Responses
| Status | Meaning |
|---|---|
400 | id is missing or cannot be coerced to an integer, or no_siniestro is not a valid string. |
401 | Missing or invalid Bearer token. |
403 | Authenticated user does not have the Administrador role. |
404 | No evidencia record with the given id was found. |
500 | Internal server error — check server logs. |
Delete the Entire Evidence Folder
Administrador and Operador roles may call this endpoint.
Recursively removes the evidencias/<no_siniestro>/ directory and all of its contents from disk using fsp.rm(carpeta, { recursive: true, force: true }). This permanently wipes both the evidencias/ (photos) and DOCUMENTOS REPARACION/ subfolders in a single operation. Database records are not removed by this endpoint — use Delete a Single Evidence File to clean up individual DB rows if needed.
Path Parameters
The siniestro number of the expediente whose evidence folder should be removed (e.g.
SIN-2024-001). The server validates that the resolved path stays within EVIDENCIAS_BASE (the hardcoded base directory derived from __dirname in evidencias.routes.ts) to prevent path traversal attacks.Example Request
Response
200 — Success
Always
true when the folder has been removed (or did not exist — force: true suppresses “not found” errors).Error Responses
| Status | Meaning |
|---|---|
400 | no_siniestro is not a valid string, or the resolved path falls outside EVIDENCIAS_BASE (path traversal guard). |
401 | Missing or invalid Bearer token. |
403 | Authenticated user does not have the Administrador or Operador role. |
500 | Filesystem error while removing the directory — check server logs. |