AnDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Glemynart/SaaS/llms.txt
Use this file to discover all available pages before exploring further.
ExpedienteDoc record represents a single file stored in a tenant’s Cloudflare R2 bucket as part of an employee’s digital dossier (expediente digital). Documents can originate from the automated PDF generation pipeline — in which case the generatedDocumentId field links back to the source GeneratedDocument — or they can be uploaded manually through future upload endpoints. Every record tracks the storage key, MIME type, file size in bytes, and a version counter that increments when a new version of the same document is uploaded. The ExpedienteDocsService also computes per-category statistics that give a quick overview of the completeness of an employee’s file.
All endpoints require a valid JWT.
List expediente docs for an employee
ExpedienteDoc records belonging to the specified employee, ordered by createdAt descending, together with a category statistics summary.
Employee identifier. Returns
404 Not Found if the employee does not exist within the authenticated tenant.Full list of document records for the employee. Each item includes a nested
generatedDocument object ({ id, nombre, tipo }) when the document was produced by the generation pipeline, or null for manually uploaded files.Document record identifier.
Owning employee identifier.
Document category (see Category reference below).
Original file name or display name.
R2 object key (see Storage key convention).
MIME type of the stored file, e.g.
"application/pdf" or "image/jpeg".File size in bytes.
Version counter. Starts at
1 and increments each time a replacement file is uploaded for the same logical document.Reference to the
GeneratedDocument that produced this file, or null for manual uploads.Reference to the associated
Contrato, if applicable.Optional human-readable description.
Date of the document itself (e.g. the effective date of a certificate).
Document expiry date. Used by the alert scheduler.
Whether this document must be renewed before its expiry date.
Snapshot of the display name of the user who uploaded the file. Preserved even if the user account is later deleted.
Upload timestamp.
Total number of documents in the expediente.
Map of
ExpedienteCategoria value → document count. Only categories with at least one document are included (e.g. { "CONTRATO": 3, "CERTIFICADO": 1 }).createdAt timestamp of the most recently added document, or null if the expediente is empty.Get expediente doc
ExpedienteDoc record with both employee and generated-document relations expanded.
Expediente document identifier.
Document record identifier.
Owning employee identifier.
Document category enum value.
File display name.
R2 object key.
MIME type.
File size in bytes.
Version counter.
Source generated document, or
null.Associated contract, or
null.Inline employee snapshot:
{ id, primerNombre, segundoNombre, primerApellido, segundoApellido }.Inline generated document snapshot:
{ id, nombre, tipo }, or null.Upload timestamp.
Delete expediente doc
ExpedienteDoc record from the database. The corresponding R2 object is not deleted automatically in this API version; object lifecycle management must be handled separately.
Expediente document identifier.
Identifier of the deleted record.
Category reference
| Category | Description |
|---|---|
CONTRATO | Employment contracts and addenda. PDFs generated through the document pipeline are automatically placed in this category when the source template type is CONTRACT. |
AFILIACION | Social security and benefit affiliation forms (EPS, ARL, pension fund, caja de compensación). |
CERTIFICADO | Labour certificates, educational certificates, or any other official certification. PDFs from CERTIFICATION-type templates land here. |
DOCUMENTO_PERSONAL | Identity documents, passports, and other personal identity records. |
PREAVISO | Pre-notice letters issued before contract termination. |
TERMINACION | Termination agreements, settlement documents (actas de liquidación), and related records. |
OTRO | Any document that does not fit the above categories. LETTER and MEMO template types resolve to this category. |
Storage key convention
EverystorageKey value follows this pattern:
When
POST /generated-documents/:id/generate-pdf completes successfully, the platform automatically creates an ExpedienteDoc record in the CONTRATO category (for CONTRACT-type templates) or CERTIFICADO (for CERTIFICATION-type templates). LETTER and MEMO types resolve to OTRO. No manual upload step is required.