custom_shifts
Creates, updates, deletes, gets or lists a custom_shifts resource.
Overview
| Name | custom_shifts |
| Type | Resource |
| Id | pagerduty.schedules_v3.custom_shifts |
Fields
The following fields are returned by SELECT queries:
- get
- list
Custom shift retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | |
assignments | array | Exactly one assignment per custom shift |
end_time | string (date-time) | (example: 2025-03-15T17:00:00Z) |
html_url | string (uri) | |
self | string (uri) | |
start_time | string (date-time) | (example: 2025-03-15T09:00:00Z) |
type | string | (custom_shift) |
Custom shifts retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | |
assignments | array | Exactly one assignment per custom shift |
end_time | string (date-time) | (example: 2025-03-15T17:00:00Z) |
html_url | string (uri) | |
self | string (uri) | |
start_time | string (date-time) | (example: 2025-03-15T09:00:00Z) |
type | string | (custom_shift) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, custom_shift_id | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Retrieve a single custom shift by ID.<br /> | |
list | select | id, since, until | time_zone, overflow, limit, offset | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Retrieve custom shifts for a schedule within a time range.<br /><br />since and until are required.<br /> |
create | insert | id, custom_shifts | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Create one or more custom shifts for a schedule. Custom shifts are<br />ad-hoc one-off coverage periods that exist outside of rotation events.<br /><br />Each custom shift requires exactly one assignment.<br /> | |
update | update | id, custom_shift_id, custom_shift | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Update an existing custom shift.<br /><br />If the shift has already started, only end_time can be modified.<br /> | |
delete | delete | id, custom_shift_id | <!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Delete a custom shift by ID. When the shift is not started, it deletes the shift entirely. If the shift is already started, it sets the end_time to now. It returns Bad Request when shift is already ended.<br /> |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
custom_shift_id | string | The ID of the custom shift. (example: AGO4624VGZ44ZJDFTW5NSZ2CG4) |
id | string | The ID of the schedule. (example: PSJUKNI) |
since | string (date-time) | Start of time range (ISO 8601) (example: 2026-06-01T00:00:00Z) |
until | string (date-time) | End of time range (ISO 8601) (example: 2026-06-28T23:59:59Z) |
limit | integer | |
offset | integer | |
overflow | boolean | Include shifts that extend beyond the requested time range boundaries |
time_zone | string | IANA timezone identifier for rendering shift times. Defaults to the schedule's configured time zone. (example: America/New_York) |
SELECT examples
- get
- list
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Retrieve a single custom shift by ID.<br />
SELECT
id,
assignments,
end_time,
html_url,
self,
start_time,
type
FROM pagerduty.schedules_v3.custom_shifts
WHERE id = '{{ id }}' -- required
AND custom_shift_id = '{{ custom_shift_id }}' -- required
;
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Retrieve custom shifts for a schedule within a time range.<br /><br />since and until are required.<br />
SELECT
id,
assignments,
end_time,
html_url,
self,
start_time,
type
FROM pagerduty.schedules_v3.custom_shifts
WHERE id = '{{ id }}' -- required
AND since = '{{ since }}' -- required
AND until = '{{ until }}' -- required
AND time_zone = '{{ time_zone }}'
AND overflow = '{{ overflow }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
;
INSERT examples
- create
- Manifest
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Create one or more custom shifts for a schedule. Custom shifts are<br />ad-hoc one-off coverage periods that exist outside of rotation events.<br /><br />Each custom shift requires exactly one assignment.<br />
INSERT INTO pagerduty.schedules_v3.custom_shifts (
custom_shifts,
id
)
SELECT
'{{ custom_shifts }}' /* required */,
'{{ id }}'
RETURNING
custom_shifts
;
# Description fields are for documentation purposes
- name: custom_shifts
props:
- name: id
value: "{{ id }}"
description: Required parameter for the custom_shifts resource.
- name: custom_shifts
value:
- type: "{{ type }}"
start_time: "{{ start_time }}"
end_time: "{{ end_time }}"
assignments: "{{ assignments }}"
UPDATE examples
- update
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Update an existing custom shift.<br /><br />If the shift has already started, only end_time can be modified.<br />
UPDATE pagerduty.schedules_v3.custom_shifts
SET
custom_shift = '{{ custom_shift }}'
WHERE
id = '{{ id }}' --required
AND custom_shift_id = '{{ custom_shift_id }}' --required
AND custom_shift = '{{ custom_shift }}' --required
RETURNING
custom_shift;
DELETE examples
- delete
<!-- theme: info --><br /><br />> Important note: Shift-based schedules use the V3 API and are not compatible with V2 automations. To create automations for Shift-Based Schedules, you need to:<br />><br />> 1. Update your automations to use the V3 API for all new shift-based schedules<br />> 2. Keep the V2 endpoint for your existing schedules<br />><br />> An upgrade tool for existing schedules is coming soon; your legacy schedules will keep working in the meantime. [Learn more](https://support.pagerduty.com/main/docs/shift-based-schedules-api-upgrade-examples).<br /><br />Delete a custom shift by ID. When the shift is not started, it deletes the shift entirely. If the shift is already started, it sets the end_time to now. It returns Bad Request when shift is already ended.<br />
DELETE FROM pagerduty.schedules_v3.custom_shifts
WHERE id = '{{ id }}' --required
AND custom_shift_id = '{{ custom_shift_id }}' --required
;