Add a list of incidences

This endpoint allows registering a list of incidences for the same employee.

POST /api/v1/import/incidences

Below is a detailed explanation of each of the fields that can make up the request body, with some being mandatory for the request to be successful.

Mandatory fields are marked with an asterisk (*).

Request body

JSON Analysis
{
  "lag": 0,
  "business": "string",
  "employeeId": "string",
  "incidences": [
    {
      "type": "string",
      "initTime": "string",
      "endTime": "string",
      "workedMinutes": 0,
      "from": "string",
      "to": "string",
      "id": "string",
      "orquestId": 0
    }
  ]
}
Details
  • lag*: number of days prior to the current date considered when managing the request.

  • business*: identifier configured in Orquest for the business.

  • employeeId*: identifier of the employee linked to the incidence.

  • incidences*: list of incidences linked to the employee. For each of the incidences to be registered, the following fields must be filled:

    • type*: identifier of the incidence type. It must be configured previously in Orquest.

    • initTime: start time of the incidence. It must be in HH:mm format with the following regular expression: ^([01]\d|2[0-3]):[0-5]\d$. Refers to local time, that is, the time zone of the service.

    • endTime: end time of the incidence. It must be in HH:mm format with the following regular expression: ^([01]\d|2[0-3]):[0-5]\d$. Refers to local time, that is, the time zone of the service.

    • workedMinutes*: number of minutes the employee has worked from the start of their shift until the beginning of the incidence. If the employee has not worked, it should be specified as 0.

    • from*: start date of the incidence. It must be in yyyy-MM-dd format.

    • to*: end date of the incidence. It must be in yyyy-MM-dd format.

    • id: external identifier of the incidence.

    • orquestId: identifier of the incidence in Orquest.

Request example

Once the analysis of the different fields has been done, an example of the request body is shown:

{
  "lag": 0,
  "business": "BUSINESSID",
  "employeeId": "C14A658",
  "incidences": [
    {
      "type": "01",
      "initTime": "09:00",
      "endTime": "10:00",
      "workedMinutes": 60,
      "from": "2024-05-01",
      "to": "2024-05-01",
      "id": "C14-12547"
    },
    {
      "type": "03",
      "workedMinutes": 0,
      "from": "2024-05-12",
      "to": "2024-05-30",
      "id": "C14-12549"
    }
  ]
}

Considerations

This request will generate an atomic operation that can be automatically reversed if there are errors: the error will be displayed in the response of the request.

If an incidence is not defined in the business’s incidence catalog, it cannot be assigned to any employee.

What is an incidence?

What is the lag in a request?