API Docs
Shifts

Shifts

Creating shifts lets you plan the work schedule for your organization. Publish shifts when you're ready to share the created shift with your employees. Once published, the employees can view their shifts.

End Points

Get all shifts

Required OAuth Scope: ZohoShifts.schedules.READ

Query Parameters

start_date
(Required)
Start date of range in yyyy-mm-dd format.
end_date
(Required)
End date of range in yyyy-mm-dd format.
schedules
Comma separated schedule IDs to filter shifts by schedules.
job_sites
Comma separated job site IDs to filter shifts by job sites.
positions
Comma separated position IDs to filter shifts by positions.
employees
Comma separated employee IDs to filter shifts by employees.
status
Any of published, unpublished to filter shifts by status.

Request Example

Click to copy
$ curl https://shifts.zoho.com/api/v1/{org_id}/shifts -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"

Response Example

{ "shifts": [ { "id": "7238362363823", "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "duration": 8.75, "break_duration": 1.5, "notes": "Notes for this shift", "is_published": true, "is_confirmed": true, "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "is_paid": true } ] } ] }

Create a shift

Required OAuth Scope: ZohoShifts.schedules.CREATE

Arguments

start_time
date-time
(Required)
Start time of the shift
end_time
date-time
(Required)
End time of the shift
employee_id
string
Employee ID to assign the shift. Send null to create an open shift.
count
int32
Total number of slots required in an open shift.
schedule_id
string
(Required)
Schedule ID of the shift.
position_id
string
(Required)
Position ID of the shift.
job_site_id
string
Job site ID of the shift.
notes
string
Shift notes
breaks
array
Shift breaks
Show Sub-Attributes arrow
break_id
string
(Required)
ID of a break
duration_mins
int32
Total duration of the break (in minutes).
start_time
date-time
Start time of the break.
end_time
date-time
End time of the break.

Request Example

Click to copy
$ curl https://shifts.zoho.com/api/v1/{org_id}/shifts -X POST -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f" -d '{"field":"value","field":"value"}'

Body Parameters

Click to copy
{ "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "notes": "Notes for this shift", "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z" } ] }

Response Example

{ "id": "7238362363823", "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "duration": 8.75, "break_duration": 1.5, "notes": "Notes for this shift", "is_published": true, "is_confirmed": true, "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "is_paid": true } ] }

Get a shift

Required OAuth Scope: ZohoShifts.schedules.READ

Request Example

Click to copy
$ curl https://shifts.zoho.com/api/v1/{org_id}/shifts/{id} -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"

Response Example

{ "id": "7238362363823", "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "duration": 8.75, "break_duration": 1.5, "notes": "Notes for this shift", "is_published": true, "is_confirmed": true, "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "is_paid": true } ] }

Update a shift

Required OAuth Scope: ZohoShifts.schedules.UPDATE

Arguments

start_time
date-time
Start time of the shift
end_time
date-time
End time of the shift
employee_id
string
Employee ID to assign the shift. Send null to create an open shift.
count
int32
Total number of slots required in an open shift.
schedule_id
string
Schedule ID of the shift.
position_id
string
Position ID of the shift.
job_site_id
string
Job site ID of the shift.
notes
string
Shift notes
breaks
array
Shift breaks
Show Sub-Attributes arrow
break_id
string
(Required)
ID of a break
duration_mins
int32
Total duration of the break (in minutes).
start_time
date-time
Start time of the break.
end_time
date-time
End time of the break.

Request Example

Click to copy
$ curl https://shifts.zoho.com/api/v1/{org_id}/shifts/{id} -X PUT -H "Content-Type: application/json;charset=UTF-8" -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f" -d '{"field":"value","field":"value"}'

Body Parameters

Click to copy
{ "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "notes": "Notes for this shift", "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z" } ] }

Response Example

{ "id": "7238362363823", "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "employee_id": "7238362363823", "count": 3, "schedule_id": "7238362363823", "position_id": "7238362363823", "job_site_id": "7238362363823", "duration": 8.75, "break_duration": 1.5, "notes": "Notes for this shift", "is_published": true, "is_confirmed": true, "breaks": [ { "break_id": "7238362363823", "duration_mins": 45, "start_time": "2019-08-24T14:15:22Z", "end_time": "2019-08-24T14:15:22Z", "is_paid": true } ] }

Delete a shift

Required OAuth Scope: ZohoShifts.schedules.DELETE

Request Example

Click to copy
$ curl https://shifts.zoho.com/api/v1/{org_id}/shifts/{id} -X DELETE -H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7bc2d1.8fcc9810810a216793f385b9dd6e125f"

Response Example

{ "message": "Shift deleted" }
© 2024, Zoho Corporation Pvt. Ltd. All Rights Reserved.