curl --request POST \
--url https://api.example.com/api/addendum/upload \
--header 'Content-Type: <content-type>' \
--data '
{
"division": "<string>",
"documentNumber": "<string>",
"worker": "<string>",
"entryDate": "<string>",
"start": "<string>",
"end": "<string>",
"startAddendum": "<string>",
"endAddendum": "<string>",
"address": "<string>",
"province": "<string>",
"district": "<string>",
"department": "<string>",
"salary": 123,
"salaryInWords": "<string>"
}
'{
"success": true,
"data": {
"data.totalRecords": 123,
"data.employees": [
{
"data.employees[].division": "<string>",
"data.employees[].documentNumber": "<string>",
"data.employees[].worker": "<string>",
"data.employees[].entryDate": "<string>",
"data.employees[].start": "<string>",
"data.employees[].end": "<string>",
"data.employees[].startAddendum": "<string>",
"data.employees[].endAddendum": "<string>",
"data.employees[].address": "<string>",
"data.employees[].province": "<string>",
"data.employees[].district": "<string>",
"data.employees[].department": "<string>",
"data.employees[].salary": 123,
"data.employees[].salaryInWords": "<string>"
}
]
}
}Upload an Excel file to process and generate addendum data for multiple employees
curl --request POST \
--url https://api.example.com/api/addendum/upload \
--header 'Content-Type: <content-type>' \
--data '
{
"division": "<string>",
"documentNumber": "<string>",
"worker": "<string>",
"entryDate": "<string>",
"start": "<string>",
"end": "<string>",
"startAddendum": "<string>",
"endAddendum": "<string>",
"address": "<string>",
"province": "<string>",
"district": "<string>",
"department": "<string>",
"salary": 123,
"salaryInWords": "<string>"
}
'{
"success": true,
"data": {
"data.totalRecords": 123,
"data.employees": [
{
"data.employees[].division": "<string>",
"data.employees[].documentNumber": "<string>",
"data.employees[].worker": "<string>",
"data.employees[].entryDate": "<string>",
"data.employees[].start": "<string>",
"data.employees[].end": "<string>",
"data.employees[].startAddendum": "<string>",
"data.employees[].endAddendum": "<string>",
"data.employees[].address": "<string>",
"data.employees[].province": "<string>",
"data.employees[].district": "<string>",
"data.employees[].department": "<string>",
"data.employees[].salary": 123,
"data.employees[].salaryInWords": "<string>"
}
]
}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/RaulQD/kontrak-backend/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data.xlsx, .xls, .csvMaximum file size: 10MB (10,485,760 bytes)MIME types accepted:application/vnd.openxmlformats-officedocument.spreadsheetml.sheetapplication/vnd.ms-excelapplication/excelapplication/x-excelapplication/x-msexcel{
"success": true,
"data": {
"totalRecords": 2,
"employees": [
{
"division": "Recursos Humanos",
"documentNumber": "12345678",
"worker": "Juan Pérez García",
"entryDate": "15/03/2023",
"start": "01/01/2024",
"end": "31/12/2024",
"startAddendum": "01/01/2025",
"endAddendum": "31/12/2025",
"address": "Av. Los Héroes 123, San Isidro",
"province": "Lima",
"district": "San Isidro",
"department": "Lima",
"salary": 2500,
"salaryInWords": "Dos mil quinientos soles"
},
{
"division": "Ventas",
"documentNumber": "87654321",
"worker": "María López Rodríguez",
"entryDate": "10/05/2023",
"start": "01/02/2024",
"end": "31/01/2025",
"startAddendum": "01/02/2025",
"endAddendum": "31/01/2026",
"address": "Jr. Las Flores 456, Miraflores",
"province": "Lima",
"district": "Miraflores",
"department": "Lima",
"salary": 3000,
"salaryInWords": "Tres mil soles"
}
]
}
}
{
"success": false,
"message": "No se recibió ningún archivo. Envía un campo \"excel\""
}
{
"success": false,
"message": "Tipo de archivo no permitidos .pdf. solo se permiten archivos Excel( .xlsx, .xls,.csv)"
}
{
"success": false,
"message": "Extensiones de archivo no permitidas: .txt. Solo se permiten: .xlsx, .xls, .csv"
}
{
"success": false,
"message": "El archivo excede el tamaño máximo permitido de 10MB"
}
{
"success": false,
"message": "Error de validación en los datos",
"errors": [
{
"row": 2,
"field": "documentNumber",
"message": "DNI debe tener exactamente 8 dígitos."
},
{
"row": 3,
"field": "salary",
"message": "El sueldo debe ser mayor a 0"
}
]
}
{
"success": false,
"message": "Máximo 80 empleados por lote"
}
{
"success": false,
"message": "Campo requerido faltante: division",
"errors": [
{
"row": 5,
"field": "division",
"message": "Division es requerido."
}
]
}
{
"success": false,
"message": "Error de validación en los datos",
"errors": [
{
"row": 4,
"field": "entryDate",
"message": "Fecha debe estar en formato DD/MM/YYYY"
}
]
}
curl -X POST https://api.example.com/api/addendum/upload \
-H "Content-Type: multipart/form-data" \
-F "excel=@/path/to/addendum_employees.xlsx"
curl -X POST https://api.example.com/api/addendum/upload \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "excel=@/path/to/addendum_employees.xlsx"
const formData = new FormData();
const fileInput = document.querySelector('input[type="file"]');
formData.append('excel', fileInput.files[0]);
fetch('https://api.example.com/api/addendum/upload', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
console.log('Total records:', data.data.totalRecords);
console.log('Employees:', data.data.employees);
})
.catch(error => {
console.error('Error:', error);
});
import requests
url = 'https://api.example.com/api/addendum/upload'
files = {'excel': open('addendum_employees.xlsx', 'rb')}
response = requests.post(url, files=files)
data = response.json()
if data['success']:
print(f"Total records: {data['data']['totalRecords']}")
for employee in data['data']['employees']:
print(f"Employee: {employee['worker']} - DNI: {employee['documentNumber']}")
else:
print(f"Error: {data['message']}")
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const form = new FormData();
form.append('excel', fs.createReadStream('addendum_employees.xlsx'));
axios.post('https://api.example.com/api/addendum/upload', form, {
headers: form.getHeaders()
})
.then(response => {
console.log('Success:', response.data);
console.log('Total records:', response.data.data.totalRecords);
})
.catch(error => {
console.error('Error:', error.response?.data || error.message);
});
| Field | Type | Format | Min | Max | Special Rules |
|---|---|---|---|---|---|
| division | string | - | - | - | Required, trimmed |
| documentNumber | string | 8 digits | - | - | Exactly 8 numeric digits |
| worker | string | - | - | - | Required |
| entryDate | string | DD/MM/YYYY | - | - | Valid date format |
| start | string | DD/MM/YYYY | - | - | Valid date format |
| end | string | DD/MM/YYYY | - | - | Valid date format |
| startAddendum | string | DD/MM/YYYY | - | - | Valid date format |
| endAddendum | string | DD/MM/YYYY | - | - | Valid date format |
| address | string | - | 5 chars | 200 chars | Trimmed |
| province | string | - | 2 chars | - | Trimmed |
| district | string | - | 2 chars | - | Trimmed |
| department | string | - | 2 chars | - | Trimmed |
| salary | number | - | > 0 | - | Must be positive |
| salaryInWords | string | - | 5 chars | 100 chars | Trimmed |