Create or update employee (complex)
This endpoint allows adding an employee or modifying their data using their identifier (employeeId). You can add or modify all employee data, including linked user, contracts, service associations, etc.
PUT /api/v2/businesses/{businessId}/employees/{employeeId}
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
|
Object person* Contains the personal data of the employee identified by their employeeId. |
Details
|
Object user Contains the data that links the employee to an Orquest application user. |
Details
|
Object serviceAssociations Contains information about the service associations established for the employee. |
Details
|
Object contracts Contains information about the contracts applied to the employee, in terms of hours worked, labour limitations, etc. |
Details
|
Request example
Once the analysis of the different fields is done, an example of the request body is shown:
{
"business": "BUSINESSID",
"lag": 0,
"partial": false,
"ignoreWithoutOuterId": false,
"ignoreServiceAssociations": false,
"ignoreContracts": false,
"person": {
"name": "Eva",
"surname": "García",
"birthday": "1987-05-07",
"employeeId": "170326",
"virtual": false
},
"user": {
"username": "egarcia",
"email": "egarcia@mail.com",
"nodes": [
10101
],
"roles": [
"Manager"
]
},
"serviceAssociations": [
{
"ownerProduct": "0001-G",
"product": "0001-G",
"from": "2026-01-01",
"to": null,
"disponibility": [
{
"from": "2026-01-01",
"ranges": [
{
"dayType": "ALL",
"startMinuteDay": 0,
"duration": 1440
}
],
"type": "SHIFT_PATTERN",
"timeFramePatternId": "d01e1e08-b2e4-48d1",
"weekStart": 1,
"blockedType": "NON_EXTENSIBLE_TIME"
}
]
}
],
"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"
}
]
}
Considerations
User validation
When data from the user object is included, the system validates whether the user exists in Orquest. The following scenarios are possible:
-
If the user does not exist, it is created and linked to the employee.
-
If the user exists and is already linked to the employee in the request, its information is updated. The
usernamefield is not updated; onlyemail,nodes, androlescan be modified. -
If the user exists and is linked to another employee, the operation is cancelled, and the request returns a
409 Conflicterror.
If the email address format is invalid, the request returns a 406 Not Acceptable error with the message User email is not valid.
In the roles field, the role name must exactly match one defined in the system under Business Configuration > Roles.
If any of the roles do not match those defined at the business level, the request returns a 409 Conflict error with the message some role is not valid.
Previously defined nodes and roles remain unchanged when the request is made without including these user fields.
|
An integration user can assign any role defined at the business level. |
|
If the employee category ( |