The Document Templates API manages reusable HTML templates that drive the document-generation pipeline. Each template stores aDocumentation 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.
contenido string containing HTML markup with {{VARIABLE}} placeholders. When a document is generated from a template, the service resolves each placeholder against the employee’s current data and the tenant’s profile, producing an immutable contenidoFinal snapshot. Templates are soft-deleted and support an activo toggle so they can be suspended without losing history. Four built-in template types are supported: CONTRACT, CERTIFICATION, LETTER, and MEMO.
All endpoints require a valid JWT. The base controller applies ADMIN or OPERADOR role gates, with write operations additionally requiring ADMIN.
List templates
Page number, minimum
1. Defaults to 1.Records per page, minimum
1. Defaults to 10.Case-insensitive search against
nombre and descripcion.Filter by template type. One of
CONTRACT, CERTIFICATION, LETTER, MEMO.Page of template objects.
Total matching templates.
Current page.
Page size.
Total pages.
Create template
Human-readable template name (e.g.
"Contrato término fijo 2024").Template category. One of
CONTRACT, CERTIFICATION, LETTER, MEMO.HTML body of the template. Use
{{VARIABLE}} syntax to insert dynamic values. See the Variable reference below.Short description visible in the template list.
Newly created template identifier.
Always
true on creation.Creation timestamp.
Get template
Template identifier.
Template identifier.
Template name.
Optional description.
Template type enum value.
Full HTML body with
{{VARIABLE}} placeholders.Whether the template is available for document generation.
Creation timestamp.
Last-updated timestamp.
Update template
Template identifier.
New template name.
New description.
New template type. One of
CONTRACT, CERTIFICATION, LETTER, MEMO.Replacement HTML body. Does not affect already-generated documents.
Set to
false to suspend the template without deleting it.Toggle template active state
activo boolean of the template without requiring a body. Equivalent to PATCH /:id with { "activo": !current } but more convenient for UI toggle actions.
Template identifier.
New value of the
activo flag after the toggle.Delete template
deletedAt and activo: false. The template is excluded from all list queries and cannot be selected for new document generation, but GeneratedDocument records that reference it remain intact.
Template identifier.
Identifier of the deleted template.
Timestamp of the soft delete.
Seed default templates
| Seeded template | Type |
|---|---|
| Contrato laboral estándar | CONTRACT |
| Certificación laboral | CERTIFICATION |
| Carta formal | LETTER |
| Memorando interno | MEMO |
Array of the created template records. Templates that already existed for the tenant are excluded.
Duplicate template
activo: true and its contenido, descripcion, and tipo are copied verbatim. The original is left unchanged.
Identifier of the source template to duplicate.
Custom name for the duplicate. Defaults to
"{source nombre} (copia)".Identifier of the newly created duplicate template.
Name of the duplicate.
Template variable reference
Place any of the following tokens inside yourcontenido HTML using double-brace syntax. The generation service replaces each token with the resolved value at the time POST /generated-documents/generate is called.
| Variable | Resolved value |
|---|---|
{{NOMBRE_COMPLETO}} | Employee’s full name (primerNombre segundoNombre primerApellido segundoApellido) |
{{DOCUMENTO}} | Document type and number, e.g. "CC 1012345678" |
{{CARGO}} | Job title from the employee record |
{{SALARIO}} | Monthly salary formatted as Colombian peso, e.g. "$5.800.000" |
{{TIPO_CONTRATO}} | Human-readable contract type, e.g. "Término Indefinido" |
{{FECHA_INGRESO}} | Start date in long Spanish locale, e.g. "1 de marzo de 2024" |
{{SEDE}} | Name of the assigned branch office (sedeRef.nombre), or empty string |
{{EMPRESA}} | Tenant’s razonSocial or nombre |
{{NIT}} | Tenant’s NIT |
{{REPRESENTANTE_LEGAL}} | Tenant’s legal representative name, or "No definido" |
{{LOGO_EMPRESA}} | Inline <img> tag for the tenant logo, or empty string if no logo |
{{FIRMA_REPRESENTANTE}} | Inline <img> tag for the representative signature, or empty string |
Unknown variables are left unreplaced in
contenidoFinal. Always verify your template renders correctly by generating a test document before using it in production.