Skip to main content

events

Creates, updates, deletes, gets or lists an events resource.

Overview

Nameevents
TypeResource
Idpagerduty.schedules_v3.events

Fields

The following fields are returned by SELECT queries:

Event retrieved successfully

NameDatatypeDescription
idstring (example: ABCDEFGHIJKLMNOPQRSTUVWXY2)
namestringDisplay name for this event (example: Weekly On-Call)
assignment_strategyobjectDefines 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_sincestring (date-time)When this event starts producing shifts (UTC) (example: 2025-03-03T00:00:00Z)
effective_untilstring (date-time)When this event stops producing shifts (UTC). Null means indefinite. (example: 2025-09-01T00:00:00Z)
end_timeobjectA 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_urlstring (uri)
recurrencearrayRFC 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>
selfstring (uri)
start_timeobjectA 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).
typestring (schedule_event)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, rotation_id, event_idsince, 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 />
listselectid, rotation_idlimit, 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 />
createinsertid, 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 />
updateupdateid, 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 />
deletedeleteid, 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.

NameDatatypeDescription
event_idstringThe ID of the event. (example: AGO462IDT55XVGN74FDAQUUNHY)
idstringThe ID of the schedule. (example: PSJUKNI)
rotation_idstringThe ID of the rotation. (example: AGO462IDT5ZMNFBVSROUDT6B4M)
limitinteger
offsetinteger
sincestring (date-time)Start of time range (ISO 8601) (example: 2025-01-01T00:00:00Z)
untilstring (date-time)End of time range (ISO 8601) (example: 2025-01-31T23:59:59Z)

SELECT examples

<!-- 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 }}'
;

INSERT examples

<!-- 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
;

UPDATE examples

<!-- 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

<!-- 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
;