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 evidence file (photos and documents) attached to a specific expediente. Records are returned in descending order by upload date so the most recent file appears first in the array.

Endpoint

GET /api/expedientes/:no_siniestro/evidencias
Authentication: Bearer token required. All authenticated roles (Administrador, Operador, Tecnico) may call this endpoint.

Path Parameters

no_siniestro
string
required
The siniestro number of the parent expediente (e.g. SIN-2024-001). Must match the no_siniestro primary key on the expediente table.

Example Request

curl http://localhost:3000/api/expedientes/SIN-2024-001/evidencias \
  -H "Authorization: Bearer $TOKEN"

Response

200 — Success

Returns a JSON array of evidencia objects. An empty array ([]) is returned when no evidence has been uploaded yet.
id
integer
Auto-incremented primary key of the evidencia record.
no_siniestro
string
Siniestro number of the parent expediente this file belongs to.
tipo
string | null
MIME type of the uploaded file as reported by the client, e.g. image/jpeg, application/pdf.
nombre_archivo
string | null
Original filename as provided by the uploader before any server-side renaming.
ruta
string | null
Absolute filesystem path where the file is stored on the server, e.g. .../evidencias/SIN-2024-001/evidencias/1713900000000_damage-photo.jpg.
fecha_carga
string | null
ISO 8601 timestamp of when the record was created. Defaults to the database server’s current time at insert. Example: "2024-04-23T18:25:43.511Z".
ubicacion_almacenamiento
string
Storage location enum. Always "Local" for files uploaded through this API — cloud storage is reserved for future use.Possible values: Local | Nube
subido_por
integer | null
ID of the usuario who uploaded the file. null if the uploader could not be determined.
Results are ordered by fecha_carga DESC — the most recently uploaded file appears first in the array.

Example Response Body

[
  {
    "id": 42,
    "no_siniestro": "SIN-2024-001",
    "tipo": "image/jpeg",
    "nombre_archivo": "damage-photo.jpg",
    "ruta": "/srv/app/evidencias/SIN-2024-001/evidencias/1713900000000_damage-photo.jpg",
    "fecha_carga": "2024-04-23T18:25:43.511Z",
    "ubicacion_almacenamiento": "Local",
    "subido_por": 7
  },
  {
    "id": 39,
    "no_siniestro": "SIN-2024-001",
    "tipo": "application/pdf",
    "nombre_archivo": "poliza.pdf",
    "ruta": "/srv/app/evidencias/SIN-2024-001/DOCUMENTOS REPARACION/1713800000000_poliza.pdf",
    "fecha_carga": "2024-04-22T10:00:00.000Z",
    "ubicacion_almacenamiento": "Local",
    "subido_por": 3
  }
]

Error Responses

StatusMeaning
400no_siniestro path parameter is missing or not a valid string.
401Missing or invalid Bearer token.
500Internal server error — check server logs for details.
// 400
{ "error": "Número de siniestro inválido" }

// 500
{ "error": "Error al obtener evidencias" }

Build docs developers (and LLMs) love