Add an employee’s contracts with constraints
This endpoint allows adding contracts with constraints for an employee, supporting the nature (nature) of each constraint.
PUT /api/v2/businesses/{businessId}/people/{employeeId}/contracts-with-constraints
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
|
Request example
Once all fields have been analysed, the following is an example of the request body:
{
"business": "CST",
"ignoreWithoutOuterId": false,
"contracts": [
{
"from": "2026-06-16",
"regularMinutes": 380,
"weeklyContract": false,
"dailyContract": true,
"countingDays": "WEEKENDS_AND_HOLIDAYS",
"additionalMinutes": 150,
"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",
"constraints": [
{
"id": "constraint.shift_duration_alternatives",
"parameters": {},
"blocks": {
"1": {
"shiftDuration": 630
},
"2": {
"shiftDuration": 1230
}
},
"blocking": false,
"nature": "PERSONAL"
},
{
"id": "constraint.presence_min_total_minutes",
"parameters": {
"min": "240"
},
"blocking": false
}
]
}
]
}
If all data is correct, the contracts will be created for the employee with the characteristics and constraints specified in the request.
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.
This endpoint supports the nature field on each constraint, allowing you to explicitly indicate whether it was entered manually (PERSONAL) or comes from a contract type or an import (CONTRACT_TYPE).
|
It is recommended to check the response body in case of error, as it includes relevant information for diagnosis and debugging, such as the invalid field or the unrecognized value. |
Useful links
What is a contract? And a contract type?
What is a constraint?