Add contracts with constraints
This endpoint allows adding contracts with constraints for an employee.
PUT /api/v2/businesses/{businessId}/employees/{employeeId}/contracts
A detailed explanation of each field that can make up the request body is provided below.
|
Required fields are marked with (*). Accepted values for |
Request body
| JSON analysis |
|---|
Details
|
contracts List of contracts defined for the employee in the URL. Each contract can have its own constraints. |
Details
|
Request example
Once all fields have been analysed, the following is an example of the request body:
{
"business": "BUSINESSID",
"ignoreWithoutOuterId": false,
"ignoreConstraints": false,
"contracts": [
{
"from": "2026-01-15",
"to": null,
"regularMinutes": 360,
"weeklyContract": false,
"dailyContract": true,
"countingDays": "WEEKENDS_AND_HOLIDAYS",
"additionalMinutes": 120,
"regularControlPeriod": "MONTHLY",
"regularPeriodMultiplier": 1,
"regularPeriodStartDate": "2026-01-15",
"additionalControlPeriod": "MONTHLY",
"additionalPeriodMultiplier": 1,
"additionalPeriodStartDate": "2026-01-15",
"calendarDaysOff": true,
"numberOfHolidays": 10,
"numberOfPublicHolidays": 10,
"weeklyDaysInvolved": "LABOR_DAYS",
"costPerHour": 200.34,
"personCategory": "AV",
"completed": false,
"additionalDailyContract": true,
"additionalWeeklyContract": false,
"regularCountingDayType": "WEEKENDS",
"additionalCountingDayType": "WEEKENDS",
"constraints": [
{
"id": "constraint.presence_total_minutes",
"parameters": {
"max": 360
},
"blocking": false
},
{
"id": "constraint.weekly_rotative_rest",
"parameters": {
"mandatory": true,
"rest": 4.0,
"rotation": 4.0
},
"blocking": false
}
]
}
]
}
If all data is correct, a contract will be created for the employee with the characteristics and constraints specified in the request (Maximum shift duration and Free days rotation).
Considerations
If the employee specified in the URL does not exist, the request will return a 404 Not Found error indicating Person does not exist.
If the constraint identifier (id) does not match any constraint in the business catalog, the request will return a 400 Bad Request error indicating Constraint not found in business catalog.
If contractTypeId is sent, all constraints —including those defined manually— are replaced by those from the contract type.
If contractTypeId is not sent, only constraints whose origin is Importer are replaced by those in the request; constraints defined manually are preserved in the system.
A contract type and constraints cannot be sent in the same request: if both contractTypeId and constraints are sent, the request will return a 400 Bad Request error indicating […] cannot specify both contractTypeId and constraints simultaneously.
Useful links
What is a contract? And a contract type?
What is a constraint?