Skip to main content

Events

The Event Object

PropertyTypeDescription
start_datetimedatetimeThe start datetime of the event.
end_datetimedatetimeThe end datetime of the event.
layerintegerThe escalation layer number this event is assigned to.
time_zonestringThe valid time zone name the event will respect.
repeatbooleanFlag dictating whether or not this is a repeating event.
frequencyintegerA the scalar unit of how often this event repeats.
frequency_unitstringThe unit of the frequency scalar. hourly|daily|weekly|monthly|yearly
days_of_weekinteger[]Array of integers representing the days of the week this event is applicable to. Sunday = 0, Monday=1, ..., Saturday = 6.
repeat_end_datetimedatetimeThe datetime the repeating end stops. This datetime is inclusive (meaning if the event falls on this day, it will occur on this day).
rotationbooleanFlag dictating whether or not this is a rotation event.
parent_idstringThe parent Event ID (if this is an override).
schedule_idsstring[]The schedule IDs this event belongs to.
event_attendeesEventAttendee[], _id, attendee_type,
exceptionsEventException[], _datetime

Create a Event

POST https://api.pagertree.com/api/v4/events

Allowed Parameters

def event_params
params.permit(
:parent_id,
:start_datetime,
:end_datetime,
:layer,
:time_zone,
:repeat,
:frequency,
:frequency_unit,
:repeat_end_datetime,
:rotation,
days_of_week: [],
schedule_ids: [],
account_user_ids: [],
)
end

Required Parameters

  • start_datetime
  • end_datetime
  • layer
  • time_zone
  • at least 1 Account User ID
  • if repeat is true
    • frequency
    • frequency_unit

Retrieve an Event

GET https://api.pagertree.com/api/v4/events/:id

Update an Event

PUT https://api.pagertree.com/api/v4/events/:id

Delete an Event

DELETE https://api.pagertree.com/api/v4/events/:id

List all Events

GET https://api.pagertree.com/api/v4/events

Override an Event

Overrides an existing event with a new one (handles breaking up the event, just like the UI).

POST https://api.pagertree.com/api/v4/events/:id/override

Required Parameters

Body ParameterDescription
start_timeStart time for the override in format "YYYY-MM-DD HH".
end_timeEnd time for the override in format "YYYY-MM-DD HH".
layerLayer of the override.
time_zoneA valid time zone name that the override will respect.
account_user_idsArray of Account User IDs that will attend the override.
action_timeThe start time of the occurrence to override (iso8601 format).

Example Request

POST https://api.pagertree.com/api/v4/events/:id/override
{
"start_time": "2022-11-01 08:00",
"end_time": "2022-11-01 17:00",
"layer": 1,
"time_zone": "Arizona",
"account_user_ids": ["01GGR2FB6045ZAXXXXXXXXXXXX"],
"action_time": "2022-11-01T00:00:00.000-07:00"
}

Add an Event Exception

Adds an exception for a repeating event (aka "delete a single occurrence").

POST https://api.pagertree.com/api/v4/events/:id/add_exception

Required Parameters

Body ParameterDescription
action_timeThe start time of the occurrence to add as an exception (aka "delete a single occurrence") (iso8601 format)

Example Request

POST https://api.pagertree.com/api/v4/events/:id/add_exception
{
"action_time": "2022-11-01T00:00:00.000-07:00"
}

Terminate an Event

Deletes the occurrence and all future occurrences of a repeating event.

POST https://api.pagertree.com/api/v4/events/:id/terminate_on

Required Parameters

Body ParameterDescription
action_timeThe start time of the first occurrence to delete (iso8601 format)

Example Request

POST https://api.pagertree.com/api/v4/events/:id/terminate_on
{
"action_time": "2022-11-01T00:00:00.000-07:00"
}

List all Event Time Zones

Returns the list of all valid time zones currently supported by PagerTree.

It's possible these change over time as new time zones are added and removed from the world.

GET https://api.pagertree.com/api/v4/events/time_zones

Valid Time Zone Names

As a convenience, we have listed supported time zones (as of September 25, 2022) below:

  • International Date Line West
  • American Samoa
  • Midway Island
  • Hawaii
  • Alaska
  • Pacific Time (US & Canada)
  • Tijuana
  • Arizona
  • Chihuahua
  • Mazatlán
  • Mountain Time (US & Canada)
  • Central America
  • Central Time (US & Canada)
  • Guadalajara
  • Mexico City
  • Monterrey
  • Saskatchewan
  • Bogota
  • Eastern Time (US & Canada)
  • Indiana (East)
  • Lima
  • Quito
  • Atlantic Time (Canada)
  • Caracas
  • Georgetown
  • La Paz
  • Puerto Rico
  • Santiago
  • Newfoundland
  • Brasilia
  • Buenos Aires
  • Greenland
  • Montevideo
  • Mid-Atlantic
  • Azores
  • Cape Verde Is.
  • Edinburgh
  • Lisbon
  • London
  • Monrovia
  • UTC
  • Amsterdam
  • Belgrade
  • Berlin
  • Bern
  • Bratislava
  • Brussels
  • Budapest
  • Casablanca
  • Copenhagen
  • Dublin
  • Ljubljana
  • Madrid
  • Paris
  • Prague
  • Rome
  • Sarajevo
  • Skopje
  • Stockholm
  • Vienna
  • Warsaw
  • West Central Africa
  • Zagreb
  • Zurich
  • Athens
  • Bucharest
  • Cairo
  • Harare
  • Helsinki
  • Jerusalem
  • Kaliningrad
  • Kyiv
  • Pretoria
  • Riga
  • Sofia
  • Tallinn
  • Vilnius
  • Baghdad
  • Istanbul
  • Kuwait
  • Minsk
  • Moscow
  • Nairobi
  • Riyadh
  • St. Petersburg
  • Volgograd
  • Tehran
  • Abu Dhabi
  • Baku
  • Muscat
  • Samara
  • Tbilisi
  • Yerevan
  • Kabul
  • Ekaterinburg
  • Islamabad
  • Karachi
  • Tashkent
  • Chennai
  • Kolkata
  • Mumbai
  • New Delhi
  • Sri Jayawardenepura
  • Kathmandu
  • Almaty
  • Astana
  • Dhaka
  • Urumqi
  • Rangoon
  • Bangkok
  • Hanoi
  • Jakarta
  • Krasnoyarsk
  • Novosibirsk
  • Beijing
  • Chongqing
  • Hong Kong
  • Irkutsk
  • Kuala Lumpur
  • Perth
  • Singapore
  • Taipei
  • Ulaanbaatar
  • Osaka
  • Sapporo
  • Seoul
  • Tokyo
  • Yakutsk
  • Adelaide
  • Darwin
  • Brisbane
  • Canberra
  • Guam
  • Hobart
  • Melbourne
  • Port Moresby
  • Sydney
  • Vladivostok
  • Magadan
  • New Caledonia
  • Solomon Is.
  • Srednekolymsk
  • Auckland
  • Fiji
  • Kamchatka
  • Marshall Is.
  • Wellington
  • Chatham Is.
  • Nuku'alofa
  • Samoa
  • Tokelau Is.