Upload a file as evidence for an insurance claim expediente. The file is stored on the server’s local filesystem inside a folder named after the siniestro number and organised by type. A newDocumentation 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.
evidencia database record is created with the file’s metadata and a reference to the stored path.
Endpoint
Administrador and Operador roles may upload evidence.
Path Parameters
The siniestro number of the parent expediente (e.g.
SIN-2024-001). The server verifies the expediente exists in the database before creating the record. Returns 404 if not found.Query Parameters
Controls which subfolder the file lands in. When set to
"documento", the file is saved under DOCUMENTOS REPARACION/. Omit this parameter (or use any other value) to store the file under the evidencias/ subfolder.| Value | Destination subfolder |
|---|---|
"documento" | DOCUMENTOS REPARACION/ |
| (omitted) | evidencias/ |
Request Body
Content-Type:multipart/form-data
The file to upload. Any MIME type is accepted. Maximum file size is 50 MB — requests exceeding this limit are rejected with
413.The evidence base directory is resolved at startup as
path.join(__dirname, '..', '..', 'evidencias') inside evidencias.routes.ts, placing it two levels above the compiled routes file (i.e. <project-root>/evidencias/). This path is hardcoded in the routes file and is not controlled by the EVIDENCIAS_DIR environment variable — that variable is only used by the health and status-check utilities for reporting purposes. Ensure <project-root>/evidencias/ exists and is writable by the Node.js process before uploading files.Example Requests
File Storage Layout
Files are organised under theevidencias/ base directory as follows:
<unix_timestamp_ms>_<sanitized_original_name> — spaces in the original filename are replaced with underscores (file.originalname.replace(/\s+/g, '_')). This scheme prevents collisions when the same filename is uploaded multiple times.
Response
201 — Created
Returns the newly createdevidencia database record.
Auto-incremented primary key of the new evidencia record.
Siniestro number of the parent expediente, echoed from the path parameter.
MIME type of the uploaded file as reported by multer (e.g.
image/jpeg, application/pdf).Original filename provided by the client before server-side renaming.
Absolute filesystem path of the saved file as returned by multer after writing to disk. Use this path to serve or reference the file later.
ISO 8601 timestamp set automatically by the database at insert time.
Always
"Local" for files uploaded through this endpoint.ID of the authenticated
usuario who performed the upload. Sourced from the JWT payload.Example Response Body
Error Responses
| Status | Meaning |
|---|---|
400 | No file was included in the request body, or no_siniestro is not a valid string. |
401 | Missing or invalid Bearer token. |
403 | Authenticated user does not have the Administrador or Operador role. |
404 | No expediente with the given no_siniestro exists in the database. |
413 | Uploaded file exceeds the 50 MB size limit. |
500 | Internal server error while saving the record — check server logs. |