Copiar desde plantilla
curl --request POST \
--url https://api.filexpress.app/api/external/hr/labor-rules/from-template \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-11-01"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
effective_from: '2026-11-01'
})
};
fetch('https://api.filexpress.app/api/external/hr/labor-rules/from-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/hr/labor-rules/from-template"
payload = {
"template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-11-01"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/hr/labor-rules/from-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'effective_from' => '2026-11-01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"business_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"country_code": "SV",
"name": "El Salvador – Código de Trabajo",
"source_template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-01-01",
"effective_to": null,
"schema_version": 1,
"params": {
"timezone": "America/El_Salvador",
"day_band": {
"start": "06:00",
"end": "19:00"
},
"mixed_rule": {
"type": "night_if_night_minutes_gt",
"threshold_minutes": 240
},
"max_ordinary": {
"daily": {
"day": 480,
"night": 420,
"mixed": 480
},
"weekly": {
"day": 2640,
"night": 2340,
"mixed": 2640
}
},
"week_starts_on": 1,
"default_rest_days": [
7
],
"default_daily_minutes": {
"1": 480,
"2": 480,
"3": 480,
"4": 480,
"5": 480,
"6": 240,
"7": 0
},
"overtime": {
"basis": [
"daily",
"weekly"
],
"daily_cap_minutes": null,
"weekly_cap_minutes": null,
"total_daily_cap_minutes": null,
"requires_approval": false
},
"surcharges": {
"ordinary_day": 0,
"ordinary_night": 0.25,
"overtime_day": 1,
"overtime_night": 1.5,
"rest_day": 0.5,
"holiday": 1,
"combination": "multiplicative"
},
"rest_day_compensatory": true,
"breaks": {
"paid": false,
"min_minutes": 30,
"auto_deduct_minutes": 0
},
"tolerances": {
"late_grace_minutes": 5,
"early_leave_grace_minutes": 0,
"absence_after_minutes": null
},
"rounding": {
"unit_minutes": 1,
"mode": "none"
},
"min_hourly_wage": 1.7,
"currency": "USD"
},
"is_active": true,
"is_template": false,
"recalculation_queued": true
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Not found."
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Copiar desde plantilla
Crea una vigencia de la empresa con los parámetros de la plantilla. Cierra el día previo la vigencia abierta anterior.
Permiso requerido: hr.labor_rules.write
POST
/
hr
/
labor-rules
/
from-template
Copiar desde plantilla
curl --request POST \
--url https://api.filexpress.app/api/external/hr/labor-rules/from-template \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-11-01"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
effective_from: '2026-11-01'
})
};
fetch('https://api.filexpress.app/api/external/hr/labor-rules/from-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/hr/labor-rules/from-template"
payload = {
"template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-11-01"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/hr/labor-rules/from-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'effective_from' => '2026-11-01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"business_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"country_code": "SV",
"name": "El Salvador – Código de Trabajo",
"source_template_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"effective_from": "2026-01-01",
"effective_to": null,
"schema_version": 1,
"params": {
"timezone": "America/El_Salvador",
"day_band": {
"start": "06:00",
"end": "19:00"
},
"mixed_rule": {
"type": "night_if_night_minutes_gt",
"threshold_minutes": 240
},
"max_ordinary": {
"daily": {
"day": 480,
"night": 420,
"mixed": 480
},
"weekly": {
"day": 2640,
"night": 2340,
"mixed": 2640
}
},
"week_starts_on": 1,
"default_rest_days": [
7
],
"default_daily_minutes": {
"1": 480,
"2": 480,
"3": 480,
"4": 480,
"5": 480,
"6": 240,
"7": 0
},
"overtime": {
"basis": [
"daily",
"weekly"
],
"daily_cap_minutes": null,
"weekly_cap_minutes": null,
"total_daily_cap_minutes": null,
"requires_approval": false
},
"surcharges": {
"ordinary_day": 0,
"ordinary_night": 0.25,
"overtime_day": 1,
"overtime_night": 1.5,
"rest_day": 0.5,
"holiday": 1,
"combination": "multiplicative"
},
"rest_day_compensatory": true,
"breaks": {
"paid": false,
"min_minutes": 30,
"auto_deduct_minutes": 0
},
"tolerances": {
"late_grace_minutes": 5,
"early_leave_grace_minutes": 0,
"absence_after_minutes": null
},
"rounding": {
"unit_minutes": 1,
"mode": "none"
},
"min_hourly_wage": 1.7,
"currency": "USD"
},
"is_active": true,
"is_template": false,
"recalculation_queued": true
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Not found."
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}