All file endpoints require a valid JWT token sent in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Medinaallan/ContabilidadISV/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <token> header. Files are uploaded as multipart/form-data and stored in the server-side uploads/ directory with a UUID-prefixed filename to prevent collisions. Once uploaded, an Excel workbook is automatically parsed with SheetJS (xlsx): each sheet is converted to JSON, numeric column totals are computed, and the resulting data is persisted as a consolidated reference that can be retrieved later via GET /api/files/data/:fileId.
Only
.xlsx and .xls files are accepted. PDFs, CSVs, and all other file
types are rejected with 400 Bad Request. The server-side size cap is
controlled by the MAX_FILE_SIZE environment variable and defaults to
10 MB.POST /api/files/upload
Uploads an Excel workbook. The request must bemultipart/form-data. The file
field name must be excelFile.
Request
The Excel workbook to upload. Accepted MIME types:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
(.xlsx) and application/vnd.ms-excel (.xls). Maximum size: 10 MB.201 Created
Confirmation string:
"Archivo subido exitosamente".Metadata for the uploaded file.
| Status | Reason |
|---|---|
400 | No file provided, or file type is not .xlsx/.xls |
413 | File exceeds the 10 MB size limit |
401 | Missing or invalid JWT |
GET /api/files/history
Returns a list of all uploaded files with their metadata. Admins see every file from every user; non-admin users see only their own uploads. Query parameters(Admin only) Filter results to files uploaded by a specific user ID.
Ignored for non-admin callers.
Array of file metadata objects ordered by upload date (most recent first).
GET /api/files/download/:fileId
Downloads the raw Excel file identified byfileId as a binary file
attachment. Admins can download any file; non-admin users can only download
files they uploaded themselves.
Path parameter
The numeric ID of the file to download (from the
history list or upload
response).Content-Disposition: attachment).
The server calls res.download() which sets the correct headers so the browser
or curl client receives the file under its original name.
| Status | Reason |
|---|---|
403 | Non-admin user trying to download another user’s file |
404 | File record not found in the database, or physical file missing on disk |
GET /api/files/data/:fileId
Returns the parsed and consolidated data extracted from the uploaded Excel workbook. The data was pre-processed on upload — each worksheet is represented as an object with row data and computed numeric column totals. Path parameterThe numeric ID of the file whose consolidated data to retrieve.
Summary of the source file.
Array of consolidated sheet objects. Each entry corresponds to one worksheet
in the workbook and contains:
| Status | Reason |
|---|---|
403 | Non-admin user trying to view another user’s file data |
404 | File record not found |
Related pages
- Auth API — obtain the JWT required by all file endpoints
- Consolidaciones API — create consolidation records from uploaded data
- Features → Export — export consolidated results back to Excel
- Configuration → Environment —
MAX_FILE_SIZEand upload directory settings