rotations
Creates, updates, deletes, gets or lists a rotations resource.
Overview
| Name | rotations |
| Type | Resource |
| Id | pagerduty.schedules_v3.rotations |
Fields
The following fields are returned by SELECT queries:
- get
- list
Rotation retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ABCDEFGHIJKLMNOPQRSTUVWXY2) |
events | array | Events in this rotation |
html_url | string (uri) | |
self | string (uri) | |
type | string | (schedule_rotation) |
Rotations retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ABCDEFGHIJKLMNOPQRSTUVWXY2) |
events | array | Events in this rotation |
html_url | string (uri) | |
self | string (uri) | |
type | string | (schedule_rotation) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, rotation_id | since, until | <!-- 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 rotation by ID including all its events.<br /> |
list | select | id | 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 all rotations for a schedule.<br /> |
create | insert | 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 />Create a new empty rotation for a schedule. After creating a rotation,<br />add events to define the on-call pattern.<br /><br />Note: Rotations have no configuration of their own — all scheduling<br />logic (recurrence, assignment strategy, members) is specified on events.<br />The request body must be empty or {}.<br /> | |
delete | delete | id, rotation_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 rotation and all its events.<br /><br />On deletion, past events are preserved in the audit history, the current<br />active event is truncated to the deletion time, and future events are<br />removed.<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 |
|---|---|---|
id | string | The ID of the schedule. (example: PSJUKNI) |
rotation_id | string | The ID of the rotation. (example: AGO462IDT5ZMNFBVSROUDT6B4M) |
limit | integer | |
offset | integer | |
since | string (date-time) | Start of time range (ISO 8601) (example: 2025-01-01T00:00:00Z) |
until | string (date-time) | End of time range (ISO 8601) (example: 2025-01-31T23:59:59Z) |
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 rotation by ID including all its events.<br />
SELECT
id,
events,
html_url,
self,
type
FROM pagerduty.schedules_v3.rotations
WHERE id = '{{ id }}' -- required
AND rotation_id = '{{ rotation_id }}' -- required
AND since = '{{ since }}'
AND until = '{{ until }}'
;
<!-- 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 all rotations for a schedule.<br />
SELECT
id,
events,
html_url,
self,
type
FROM pagerduty.schedules_v3.rotations
WHERE id = '{{ id }}' -- required
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 a new empty rotation for a schedule. After creating a rotation,<br />add events to define the on-call pattern.<br /><br />Note: Rotations have no configuration of their own — all scheduling<br />logic (recurrence, assignment strategy, members) is specified on events.<br />The request body must be empty or {}.<br />
INSERT INTO pagerduty.schedules_v3.rotations (
id
)
SELECT
'{{ id }}'
RETURNING
rotation
;
# Description fields are for documentation purposes
- name: rotations
props:
- name: id
value: "{{ id }}"
description: Required parameter for the rotations resource.
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 rotation and all its events.<br /><br />On deletion, past events are preserved in the audit history, the current<br />active event is truncated to the deletion time, and future events are<br />removed.<br />
DELETE FROM pagerduty.schedules_v3.rotations
WHERE id = '{{ id }}' --required
AND rotation_id = '{{ rotation_id }}' --required
;