Link user to an employee
This endpoint allows linking an existing user to an employee within the same business.
PUT /api/v2/businesses/{businessId}/employees/{employeeId}/user
In addition to the external business identifier (businessId), the URL must specify the external identifier of the employee to whom the user will be linked: employeeId.
In the request body, only the username of the user already registered in the system is included:
Request body
| JSON Analysis |
|---|
Details
|
Request example
Below is an example of the request:
PUT /api/v2/businesses/BUSINESSID/employees/1006350/user
{
"username": "test.user@orquest.com"
}
If the request is successful (200 OK), the response will contain the user’s linked information: username, email, nodes, and roles.
Considerations
|
If there was a previous association with another user or employee, the relationship is updated in accordance with the data defined in the request: the employee’s previous user is unlinked from them, and if the specified user was already linked to another employee, it is also unlinked from that other employee. These are two silent unlinks, without any notice in the response. |
|
Linking is not an isolated operation on the user-employee link: as part of the process, the user’s |
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
- |
The |
- |
The |
|
- |
The |
|
|
User not found. [] |
The |
|
This endpoint has its own error handling that does not follow the general API format: the three |