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,
"available": false
}
],
"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.
In the user.roles field, the role name must exactly match one defined in the system under Business Configuration > Roles.
Previously defined nodes and roles remain unchanged when the request is made without including these user fields.
|
The roles in |
|
An integration user can assign any role defined at the business level. |
|
If the employee category ( |
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
- |
The request body is not valid JSON or cannot be read. |
Time frame patter not found |
The shift pattern identifier ( |
|
Calendar disponibility type is not enabled for business |
The |
|
ContractType not found in business |
The contract type identifier ( |
|
|
Business forbidden or Product <id> does not exist |
The business or the product indicated in any of the |
|
- |
A field marked as required is missing within an object present in the request ( |
- |
A numeric field receives a negative value. |
|
- |
In a contract or a service association, the start date ( |
|
- |
The value of an enumerated field does not match any of the defined values. |
|
User email is not valid |
The email address format ( |
|
- |
One of the roles in a service association ( |
|
|
- |
The user included in the |
some role is not valid |
One of the roles in |
|
The |
|
It is recommended to review the response body in case of an error, as it includes relevant information for diagnosis and debugging, such as invalid fields or unrecognized values. |