events
Creates, updates, deletes, gets or lists an events resource.
Overview
| Name | events |
| Type | Resource |
| Id | pagerduty.schedules_v3.events |
Fields
The following fields are returned by SELECT queries:
- get
- list
Event retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ABCDEFGHIJKLMNOPQRSTUVWXY2) |
name | string | Display name for this event (example: Weekly On-Call) |
assignment_strategy | object | Defines how users are assigned on-call within an event's time window. - rotating_member_assignment_strategy: users rotate in sequence. shifts_per_member controls how many consecutive shift periods each member covers before rotating. - every_member_assignment_strategy: all listed members are on-call simultaneously for every occurrence. |
effective_since | string (date-time) | When this event starts producing shifts (UTC) (example: 2025-03-03T00:00:00Z) |
effective_until | string (date-time) | When this event stops producing shifts (UTC). Null means indefinite. (example: 2025-09-01T00:00:00Z) |
end_time | object | A time-of-day value with an explicit time zone. Used for event start_time and end_time to define the recurring window of coverage (e.g., 9 AM–5 PM every Monday in New York). |
html_url | string (uri) | |
recurrence | array | RFC 5545 recurrence rules defining the repeating pattern. This must be an array containing: <br /> - Exactly one <b>RRULE</b> <br />- Zero or more <b>EXDATE</b> <br />- Zero or more <b>RDATE</b> |
self | string (uri) | |
start_time | object | A time-of-day value with an explicit time zone. Used for event start_time and end_time to define the recurring window of coverage (e.g., 9 AM–5 PM every Monday in New York). |
type | string | (schedule_event) |
Events retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | (example: ABCDEFGHIJKLMNOPQRSTUVWXY2) |
name | string | Display name for this event (example: Weekly On-Call) |
assignment_strategy | object | Defines how users are assigned on-call within an event's time window. - rotating_member_assignment_strategy: users rotate in sequence. shifts_per_member controls how many consecutive shift periods each member covers before rotating. - every_member_assignment_strategy: all listed members are on-call simultaneously for every occurrence. |
effective_since | string (date-time) | When this event starts producing shifts (UTC) (example: 2025-03-03T00:00:00Z) |
effective_until | string (date-time) | When this event stops producing shifts (UTC). Null means indefinite. (example: 2025-09-01T00:00:00Z) |
end_time | object | A time-of-day value with an explicit time zone. Used for event start_time and end_time to define the recurring window of coverage (e.g., 9 AM–5 PM every Monday in New York). |
html_url | string (uri) | |
recurrence | array | RFC 5545 recurrence rules defining the repeating pattern. This must be an array containing: <br /> - Exactly one <b>RRULE</b> <br />- Zero or more <b>EXDATE</b> <br />- Zero or more <b>RDATE</b> |
self | string (uri) | |
start_time | object | A time-of-day value with an explicit time zone. Used for event start_time and end_time to define the recurring window of coverage (e.g., 9 AM–5 PM every Monday in New York). |
type | string | (schedule_event) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, rotation_id, event_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 specific event by ID.<br /> |
list | select | id, rotation_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 events for a rotation, ordered by start time.<br /> |
create | insert | id, rotation_id, event | <!-- 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 event that defines when and how users are on-call within<br />a rotation.<br /><br />Constraints:<br />- Maximum 5 events per rotation<br />- Events within a rotation cannot overlap<br />- effective_since must be in the future (past values are clamped to now)<br />- All users referenced in assignment_strategy.members must exist and<br /> belong to the account<br /> | |
update | update | id, rotation_id, event_id, event | <!-- 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 event.<br /><br />Restrictions based on event timing:<br />- Past events (effective_until in the past): Cannot be modified<br />- Active events (currently producing shifts): Can only update<br /> effective_until<br />- Future events (effective_since in the future): All fields can<br /> be updated<br /> | |
delete | delete | id, rotation_id, event_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 an event from a rotation.<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 |
|---|---|---|
event_id | string | The ID of the event. (example: AGO462IDT55XVGN74FDAQUUNHY) |
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 specific event by ID.<br />
SELECT
id,
name,
assignment_strategy,
effective_since,
effective_until,
end_time,
html_url,
recurrence,
self,
start_time,
type
FROM pagerduty.schedules_v3.events
WHERE id = '{{ id }}' -- required
AND rotation_id = '{{ rotation_id }}' -- required
AND event_id = '{{ event_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 events for a rotation, ordered by start time.<br />
SELECT
id,
name,
assignment_strategy,
effective_since,
effective_until,
end_time,
html_url,
recurrence,
self,
start_time,
type
FROM pagerduty.schedules_v3.events
WHERE id = '{{ id }}' -- required
AND rotation_id = '{{ rotation_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 event that defines when and how users are on-call within<br />a rotation.<br /><br />Constraints:<br />- Maximum 5 events per rotation<br />- Events within a rotation cannot overlap<br />- effective_since must be in the future (past values are clamped to now)<br />- All users referenced in assignment_strategy.members must exist and<br /> belong to the account<br />
INSERT INTO pagerduty.schedules_v3.events (
event,
id,
rotation_id
)
SELECT
'{{ event }}' /* required */,
'{{ id }}',
'{{ rotation_id }}'
RETURNING
event
;
# Description fields are for documentation purposes
- name: events
props:
- name: id
value: "{{ id }}"
description: Required parameter for the events resource.
- name: rotation_id
value: "{{ rotation_id }}"
description: Required parameter for the events resource.
- name: event
value:
name: "{{ name }}"
start_time:
date_time: "{{ date_time }}"
time_zone: "{{ time_zone }}"
end_time:
date_time: "{{ date_time }}"
time_zone: "{{ time_zone }}"
effective_since: "{{ effective_since }}"
effective_until: "{{ effective_until }}"
recurrence:
- "{{ recurrence }}"
assignment_strategy:
type: "{{ type }}"
shifts_per_member: {{ shifts_per_member }}
members:
- type: "{{ type }}"
user_id: "{{ user_id }}"
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 event.<br /><br />Restrictions based on event timing:<br />- Past events (effective_until in the past): Cannot be modified<br />- Active events (currently producing shifts): Can only update<br /> effective_until<br />- Future events (effective_since in the future): All fields can<br /> be updated<br />
UPDATE pagerduty.schedules_v3.events
SET
event = '{{ event }}'
WHERE
id = '{{ id }}' --required
AND rotation_id = '{{ rotation_id }}' --required
AND event_id = '{{ event_id }}' --required
AND event = '{{ event }}' --required
RETURNING
event;
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 an event from a rotation.<br />
DELETE FROM pagerduty.schedules_v3.events
WHERE id = '{{ id }}' --required
AND rotation_id = '{{ rotation_id }}' --required
AND event_id = '{{ event_id }}' --required
;