Download Contracts ZIP
Contracts
Download Contracts ZIP
Generate and download multiple employee contracts as a ZIP file
POST
Download Contracts ZIP
Overview
This endpoint generates contracts for multiple employees and returns them as a ZIP file. For each employee, the ZIP contains:- The employment contract PDF
- A personal data processing agreement PDF
- Contract annexes PDF
planilla/, parttime/, subsidio/).
Request
Body Parameters
The request body must be an array of employee objects (minimum 1, maximum 50 employees per batch).Array of employee objects to generate contracts for
Response
Success Response
application/zipattachment; filename="contratos-DD-MM-YYYY.zip"The filename includes the current date when the ZIP was generated.ZIP file containing all generated contracts
ZIP File Structure
The ZIP file is organized as follows:Error Responses
400 - Validation Error
400 - Empty Array
400 - Too Many Employees
Examples
Basic Example (Planilla Contract)
Multiple Employees with Different Contract Types
Implementation Notes
- The ZIP file is streamed directly to the response using Archiver with maximum compression (level 9)
- Each employee’s documents are generated in parallel using Puppeteer
- If an individual employee’s contract generation fails, the error is logged but the process continues for other employees
- The filename uses the current date in
DD-MM-YYYYformat - Folder names in the ZIP are lowercase and spaces are removed from contract types
- File paths follow the pattern:
{contractType}/{filename}for contracts and{contractType}/Tratamiento de datos/{dni}.pdffor data processing documents
Related Endpoints
- Preview Contract - Preview a single employee contract before generating a batch