Update the schedule of an employee

This API helps you to add, edit, or delete the schedule of the specified employee for any one particular day at a time.

You cannot use this API to simultaneously update the employee's schedule for multiple days.

You must provide appropriate data for the employee_id parameter.

Note: Before using this API, you must first call the GET Retrieve the schedules of employees of a center API. After you retrieve the schedule_id for the required employee, you can then use that unique schedule_id to update the employee's schedule for a specific day.

Parameters

NameTypeDescription
employee_idguidUnique 32-character ID of the specific employee. This is a mandatory parameter.

Request Body Details

NameTypeDescription
schedulesobjectObject that contains schedule details of the specific employee. For more information, refer to the schedules table below.
center_idguidUnique 32-character ID of the center at which the specified employee works.

schedules

NameTypeDescription
datedatetimeDate of the schedule of the employee.
shiftsobjectObject that contains shift details of the employee. For more information, refer to the shifts table below.

shifts

NameTypeDescription
schedule_idguidUnique 32-character ID of the schedule of the employee.
start_timedatetimeStart time of the shift of the employee.
end_timedatetimeEnd time of the shift of the employee.
statusintIndicates the status of the shift of the employee.
room_idguidThe id of the room in which the employee is scheduled to work.

Reponse Details

NameTypeDescription
successbooleanIf true, it indicates that the employee's schedule was successfully updated.
errorobjectObject that contains error message and error code details. For more information, refer to the error table below.

error

NameTypeDescription
StatusCodeintStatus code that represents the type of the error.
MessagestringMessage that describes the error.
InternalMessagestringInternal message that describes about the error in more detail.

Error Message Details

Error MessageError CodeDescription
InvalidInput502If the employee schedule details are not passed and/or the employee schedule is null.
InvalidInput502If an invalid employee_id is specified.
InvalidInput502If the specified employee schedule date is for a past date.
InvalidInput502If the specified employee does not exist in the organization. The provided login credentials might not be of an employee.
InvalidInput502If the employee has already checked in. The schedule of employees who have already checked in cannot be edited.
InvalidInput502If the number of schedules that is passed in scheduleCount is not valid. The number of schedules that can be passed for an employee must not be equal to zero and must not be more than two.
InvalidInput502If there is a mismatch between the specified start date and end date of the employee's schedule. The specified start date and end date details of an employee must always be same.
InvalidInput502If the start time of one of the schedules is greater than the end time. Start time of any schedule cannot be greater than its end time.
InvalidInput502If not all schedules could be passed.
InvalidInput502If the employee's shifts are overlapping; shifts cannot overlap.
SomethingWentWrong4023If some issue occurred due to a failure at the API level.
SomethingWentWrong438If the Zenoti user does not have the required authorization to update the employee's schedule.
Language
Credentials
Header
Click Try It! to start a request and see the response here!