--- title: "Shift" slug: "server-api-livechat-shift" updated: 2022-06-16T06:22:11Z published: 2022-06-16T06:22:11Z canonical: "developer.comm100.com/server-api-livechat-shift" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Shift ## Shift You need the Manage Settings permission to manage Shifts. - `Shifts` - Shifts Manage - `GET livechat/shifts` - [Get the list of Shifts](/docs/server-api-livechat-shift#get-the-list-of-shifts) - `GET livechat/shifts/{id}` - [Get a single Shift](/docs/server-api-livechat-shift#get-a-single-shift) - `POST livechat/shifts` - [Create a new Shift](/docs/server-api-livechat-shift#create-a-new-shift) - `PUT livechat/shifts/{id}` - [Update the Shift](/docs/server-api-livechat-shift#update-the-shift) - `DELETE livechat/shifts/{id}` - [Remove the Shift](/docs/server-api-livechat-shift#remove-the-shift) ### Shift JSON Format Shift is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the shift. | | `timeZone` | string | Time zone of the shift.Value includes all [Time Zone Option](/#timezone) identifiers. | | `autoDetectDayLightSavingsTime` | bool | Whether auto detect Daylight Saving Time or not. | | `name` | string | Name of the shift. | | `shiftHolidays` | [shiftHolidays[]](/docs/server-api-livechat-shift#shift-holiday-json-format) | Reference to Shift Holiday. | | `shiftWorkingHours` | [shiftWorkingHours[]](/docs/server-api-livechat-shift#shift-working-hours-json-format) | Reference to Shift Working Hours. | | `agentIds` | array | The list of the shift identifiers, which the agent belongs to. | | `departmentIds` | array | The list of the shift ids which the department belongs to. | ### Shift Holiday JSON Format: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the shift holiday. | | `name` | string | Name of the shift holiday. | | `holidayDate` | datetime | Date of the shift holiday. | | `shiftId` | guid | Id of the shift. | ### Shift Working Hours JSON Format: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the shift working hours. | | `shiftId` | guid | Id of the shift. | | `dayOfWeek` | string | Allowed values are "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday". | | `startTime` | time | Start time of the shift working hours. | | `endTime` | time | End time of the shift working hours. | | `agentAwayStatusId` | guid | Id of the agent away status. | ### Get the list of Shifts `GET livechat/shifts` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `include` | string | query | no | Allowed values are "agent", "department", "shiftHoliday", "shiftWorkingHours". | - #### Response: An array of [Shift](/docs/server-api-livechat-shift#shift-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/shifts \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "shifts": [ { "id": "8CAF5329-7C46-EB11-8100-00155D081D0B", "timeZone": "China Standard Time", "autoDetectDayLightSavingsTime": false, "name": "shift", "shiftHolidays": [ { "id": "8FAF5329-7C46-EB11-8100-00155D081D0B", "name": "shiftHoliday", "holidayDate": "2021-05-01", "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B" } ], "shiftWorkingHours": [ { "id": "92AF5329-7C46-EB11-8100-00155D081D0B", "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B", "dayOfWeek": "Monday", "startTime": "09:00:00", "endTime": "18:00:00", "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B" } ], "agentIds": [ "40A2EF45-7D46-EB11-8100-00155D081D0B" ], "departmentIds": [ "6fd98c99-f183-4247-bdda-47491426e577" ] } ], "nextPage": null, "previousPage": null, "total": 1 } ``` ### Get a single Shift `GET livechat/shifts/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `include` | string | query | no | Allowed values are "agent", "department", "shiftHoliday", "shiftWorkingHours". | - #### Response: [Shift](/docs/server-api-livechat-shift#shift-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "8CAF5329-7C46-EB11-8100-00155D081D0B", "timeZone": "China Standard Time", "autoDetectDayLightSavingsTime": false, "name": "shift", "shiftHolidays": [ { "id": "8FAF5329-7C46-EB11-8100-00155D081D0B", "name": "shiftHoliday", "holidayDate": "2021-05-01", "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B" } ], "shiftWorkingHours": [ { "id": "92AF5329-7C46-EB11-8100-00155D081D0B", "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B", "dayOfWeek": "Monday", "startTime": "09:00:00", "endTime": "18:00:00", "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B" } ], "agentIds": [ "40A2EF45-7D46-EB11-8100-00155D081D0B" ], "departmentIds": [ "6fd98c99-f183-4247-bdda-47491426e577" ] } ``` ### Create a new Shift `POST livechat/shifts` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `timeZone` | string | body | yes | Time zone of the shift.Value includes all [Time Zone Option](/#timezone) identifiers. | | `autoDetectDayLightSavingsTime` | bool | body | no | Whether auto detect Daylight Saving Time or not. | | `name` | string | body | yes | Name of the shift. | | `shiftHolidays` | [shiftHolidays[]](/docs/server-api-livechat-shift#shift-holiday-json-format) | body | no | Reference to Shift Holiday. | | `shiftWorkingHours` | [shiftWorkingHours[]](/docs/server-api-livechat-shift#shift-working-hours-json-format) | body | no | Reference to Shift Working Hours. | | `agentIds` | array | body | no | The list of the shift identifiers, which the agent belongs to. | | `departmentIds` | array | body | no | The list of the shift ids which the department belongs to. | - #### Response: [Shift](/docs/server-api-livechat-shift#shift-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/shifts \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"timeZone":"China Standard Time","autoDetectDayLightSavingsTime":false,"name":"shift","shiftHolidays":[{"name":"shiftHoliday","holidayDate":"2021-05-01"}],"shiftWorkingHours":[{"dayOfWeek":"Monday","startTime":"09:00:00","endTime":"18:00:00","agentAwayStatusId":"DFAF5329-7C46-EB11-8100-00155D081D0B"}]}' ``` Response: HTTP/1.1 201 Created ``` { "id": "8CAF5329-7C46-EB11-8100-00155D081D0B", "timeZone": "China Standard Time", "autoDetectDayLightSavingsTime": false, "name": "shift", "shiftHolidays": [ { "id": "8FAF5329-7C46-EB11-8100-00155D081D0B", "name": "shiftHoliday", "holidayDate": "2021-05-01", "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B" } ], "shiftWorkingHours": [ { "id": "92AF5329-7C46-EB11-8100-00155D081D0B", "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B", "dayOfWeek": "Monday", "startTime": "09:00:00", "endTime": "18:00:00", "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B" } ], "agentIds": [ "40A2EF45-7D46-EB11-8100-00155D081D0B" ], "departmentIds": [ "6fd98c99-f183-4247-bdda-47491426e577" ] } ``` ### Update the Shift `PUT livechat/shifts/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `timeZone` | string | body | yes | Time zone of the shift.Value includes all [Time Zone Option](/#timezone) identifiers. | | `autoDetectDayLightSavingsTime` | bool | body | no | Whether auto detect Daylight Saving Time or not. | | `name` | string | body | yes | Name of the shift. | | `shiftHolidays` | [shiftHolidays[]](/docs/server-api-livechat-shift#shift-holiday-json-format) | body | no | Reference to Shift Holiday. | | `shiftWorkingHours` | [shiftWorkingHours[]](/docs/server-api-livechat-shift#shift-working-hours-json-format) | body | no | Reference to Shift Working Hours. | | `agentIds` | array | body | no | The list of the shift identifiers, which the agent belongs to. | | `departmentIds` | array | body | no | The list of the shift ids which the department belongs to. | - #### Response: [Shift](/docs/server-api-livechat-shift#shift-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"timeZone":"China Standard Time","autoDetectDayLightSavingsTime":false,"name":"shift","shiftHolidays":[{"name":"shiftHoliday","holidayDate":"2021-05-01"}],"shiftWorkingHours":[{"dayOfWeek":"Monday","startTime":"09:00:00","endTime":"18:00:00","agentAwayStatusId":"DFAF5329-7C46-EB11-8100-00155D081D0B"}]}' ``` Response: HTTP/1.1 200 OK ``` { "id": "8CAF5329-7C46-EB11-8100-00155D081D0B", "timeZone": "China Standard Time", "autoDetectDayLightSavingsTime": false, "name": "shift", "shiftHolidays": [ { "id": "8FAF5329-7C46-EB11-8100-00155D081D0B", "name": "shiftHoliday", "holidayDate": "2021-05-01", "shiftId": "E0AF5329-7C46-EB11-8100-00155D081D0B" } ], "shiftWorkingHours": [ { "id": "92AF5329-7C46-EB11-8100-00155D081D0B", "shiftId": "93AF5329-7C46-EB11-8100-00155D081D0B", "dayOfWeek": "Monday", "startTime": "09:00:00", "endTime": "18:00:00", "agentAwayStatusId": "DFAF5329-7C46-EB11-8100-00155D081D0B" } ], "agentIds": [ "40A2EF45-7D46-EB11-8100-00155D081D0B" ], "departmentIds": [ "6fd98c99-f183-4247-bdda-47491426e577" ] } ``` ### Remove the Shift `DELETE livechat/shifts/{id}` - #### Parameters: No Parameters - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/shifts/8CAF5329-7C46-EB11-8100-00155D081D0B \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content