XC Documents#
Endpoints for uploading, listing, retrieving, and deleting files attached to an XC (Cross-Connect) request — LOAs, generated/signed SOW and Acta de Entrega documents, implementation evidence, etc. Files are stored in S3; this API manages both the file content and its metadata (xc_documents).Concepts#
document_type: a free-text type describing what the file is. Common values seen in the codebase: LOA_A, LOA_B, SOW_GENERADO, SOW_FIRMADO, ACTA_ENTREGA, ACTA_ENTREGA_FIRMADA, EVIDENCIA_IMPLEMENTACION. Signed documents (_FIRMADO/_FIRMADA) are typically created automatically by the DocuSign webhook rather than uploaded directly.
Optional connection scoping: a document can be tied to a specific xc_connection_id, or left request-wide if omitted.
Three ways to access a file:Get metadata — returns the database record only (name, type, size, MIME type, timestamps, relations), no file bytes.
Get download URL — returns a short-lived, pre-signed S3 URL for the client to fetch the file directly from storage (expires, 60–86400s, default 600s).
Get binary file — streams the file through the API itself, with inline=1 to render in-browser (e.g. PDF preview) instead of triggering a download.
Upload is multipart/form-data: file and document_type are required; xc_connection_id is optional.
Delete removes both the S3 object and the database record; the database record is removed even if the S3 deletion fails, to avoid orphaned rows.
Endpoints#
GET /v1/xc/requests/{id}/documentsAll documents for a request, optionally filtered by type, most recent first.POST /v1/xc/requests/{id}/documentsUploads a file and attaches it to the request.GET /v1/xc/documents/{documentId}Metadata only — no file content.GET /v1/xc/documents/{documentId}/downloadA pre-signed, time-limited S3 URL.GET /v1/xc/documents/{documentId}/fileStreams the file through the API (inline or attachment).DELETE /v1/xc/documents/{documentId}Deletes the file and its record.Source#
Router: routes/v1/xc/documents.router.js
Controller: controllers/xc/documents.controller.js
Service: services/xc/documents.service.js
Entity: entities/xc-document.js
Modified at 2026-09-25 18:11:36