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
{
  "lag": 0,
  "locationLimitations": [
    {
      "id": "string",
      "locationId": "string",
      "product": "string",
      "from": "string",
      "to": "string",
      "zone": "string",
      "location": "string"
    }
  ]
}
Details
  • lag*: number of days prior to the current date that are considered when processing the request.

  • locationLimitations*: list of limitations to be defined for the employee. Each one must contain the following data:

    • id: internal identifier of the limitation. It is not necessary to define it, the system will generate it automatically.

    • locationId: internal identifier of the task. It is not necessary to provide it.

    • product*: external identifier of the product or section.

    • from*: start date of the limitation period in yyyy-MM-dd format.

    • to: end date of the limitation period in yyyy-MM-dd format. It is possible to send null if the end date is unknown.

    • zone: external identifier of the zone. If no zone is specified, the limitation will be set for the task in the general zone.

    • location*: external identifier of the task for which the limitation is set.

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

If the product specified in the request body does not exist in the business, the request will return a 404 Not Found error, with the message not exits.

If the external zone identifier does not match any zone in the product, the request will return an error indicating No zone found.

If the external task identifier does not match any task enabled for the specified product or zone, the request will return a 404 Not Found error, with the message Location not found.

To visualize the limitations in the interface, the employee must already have the aptitude defined for that task.

What is a task? And what is an aptitude in a task?

What is lag in a request?