Events

The Event Object

PropertyTypeDescription

start_datetime

datetime

The start datetime of the event.

end_datetime

datetime

The end datetime of the event.

layer

integer

The escalation layer number this event is assigned to.

time_zone

string

The valid time zone name the event will respect.

repeat

boolean

Flag dictating whether or not this is a repeating event.

frequency

integer

A the scalar unit of how often this event repeats.

frequency_unit

string

The unit of the frequency scalar. hourly|daily|weekly|monthly|yearly

days_of_week

integer[]

Array of integers representing the days of the week this event is applicable to. Sunday = 0, Monday=1, ..., Saturday = 6.

repeat_end_datetime

datetime

The datetime the repeating end stops. This datetime is inclusive (meaning if the event falls on this day, it will occur on this day).

rotation

boolean

Flag dictating whether or not this is a rotation event.

parent_id

string

The parent Event ID (if this is an override).

schedule_ids

string[]

The schedule IDs this event belongs to.

event_attendees

EventAttendee[]

:id, :attendee_id, attendee_type, :position

exceptions

EventException[]

:id, :start_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_time

Start time for the override in format "YYYY-MM-DD HH:mm".

end_time

End time for the override in format "YYYY-MM-DD HH:mm".

layer

Layer of the override.

time_zone

A valid time zone name that the override will respect.

account_user_ids

Array of Account User IDs that will attend the override.

action_time

The 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_time

The 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_time

The 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.

Last updated