Update an incidence

This endpoint allows updating the information of a previously registered incidence for an employee.

PUT /api/v1/import/incidence

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
{
  "business": "string",
  "employeeId": "string",
  "type": "string",
  "initTime": "string",
  "endTime": "string",
  "workedMinutes": 0,
  "from": "string",
  "to": "string",
  "id": "string",
  "orquestId": 0
}
Details
  • business*: identifier configured in Orquest for the business.

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

  • type*: identifier of the incidence type. It must be previously configured 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 workday until the start of the incidence. If the employee hasn’t worked, specify 0.

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

  • to*: date when the incidence ends. 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 carried out, an example of the request body is shown:

{
  "business": "BUSINESSID",
  "employeeId": "C14A658",
  "type": "01",
  "initTime": "08:30",
  "endTime": "09:30",
  "workedMinutes": 30,
  "from": "2024-04-15",
  "to": "2024-04-15",
  "id": "C14-12545"
}

Considerations

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

If there is an existing incidence that overlaps with the new incidence sent in the request, the previous incidence will be deleted.

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