Add person limitations
This endpoint allows to create employee limitations for performing specific tasks.
POST /api/v1/business/{businessId}/employees/{employeeId}/locationLimitations
The URL must contain the business identifier (businessId) and the employee identifier (employeeId).
Below is an explanation of each field in the request body.
|
Mandatory fields are marked with an asterisk (*). |
Request body
| JSON Analysis |
|---|
Details
|
Request example
After analyzing the different fields, here is an example request:
POST /api/v1/business/BUSINESSID/employees/EMPLOYEEID/locationLimitations
{
"lag": 0,
"locationLimitations": [
{
"product": "0001-GENERAL",
"from": "2025-09-30",
"to": null,
"zone": "Z1",
"location": "01"
},
{
"product": "0001-GENERAL",
"from": "2025-10-15",
"to": "2025-10-25",
"zone": "Z1",
"location": "02"
}
]
}
If the request data is correct, the request will return a 200 OK status and the limitations will be set for the employee in the specified tasks.
Considerations
|
A |
Unlike other endpoints that integrate lists of elements (see lag), here lag is not limited to protecting existing information from deletion: it also validates the limitations sent in the request itself. If any of them has a from date earlier than the current date minus lag days, the entire request is rejected with the not_in_range error.
To visualize the limitations in the interface, the employee must already have the aptitude defined for that task.
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 one of its fields does not have the expected format. |
|
Lag mut be positive or zero |
The |
Limitations list cannot be null |
The |
|
invalid_to_date |
The |
|
- |
not_in_range |
The |