PingPlotter Cloud Manual

Schedules


Overview

Schedules set the days and hours that Alerts using them are allowed to notify. They don't change whether an Alert triggers, only when it notifies.

API keys need the Alerts Read permission to read and the Alerts Write permission to make changes. See API Key Permissions.

GET

GET /schedules

Retrieve all schedules.

curl -X 'GET' \
   'https://yoursubdomain.api.pingplotter.cloud/schedules' \
   -H 'accept: application/json' \
   -H 'X-API-KEY: your_api_token'

200 Response

[
   {
      "ScheduleId": "string",
      "Name": "string",
      "Timezone": "America/Denver",
      "Days": [
         "Mon",
         "Tue",
         "Wed",
         "Thu",
         "Fri"
      ],
      "Start": "08:00",
      "End": "17:30",
      "AgentIds": [
         "string"
      ],
      "Open": true,
      "UsedByAlerts": [
         {
            "AlertId": "string",
            "Name": "string"
         }
      ]
   }
]

Open shows whether the schedule is open right now. UsedByAlerts lists the Alerts that use it.

GET /schedules/{scheduleId}

Retrieve a single schedule.

curl -X 'GET' \
   'https://yoursubdomain.api.pingplotter.cloud/schedules/{scheduleId}' \
   -H 'accept: application/json' \
   -H 'X-API-KEY: your_api_token'

200 Response

{
   "ScheduleId": "string",
   "Name": "string",
   "Timezone": "America/Denver",
   "Days": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri"
   ],
   "Start": "08:00",
   "End": "17:30",
   "AgentIds": [
      "string"
   ],
   "Open": true,
   "UsedByAlerts": [
      {
         "AlertId": "string",
         "Name": "string"
      }
   ]
}

POST

POST /schedules

Create a schedule. Assign it to Alerts with ScheduleIds when you create or update an Alert.

curl -X 'POST' \
   'https://yoursubdomain.api.pingplotter.cloud/schedules' \
   -H 'accept: application/json' \
   -H 'X-API-KEY: your_api_token' \
   -H 'Content-Type: application/json' \
   -d '{
      "Name": "Business hours",
      "Timezone": "America/Denver",
      "Days": [
         "Mon",
         "Tue",
         "Wed",
         "Thu",
         "Fri"
      ],
      "Start": "08:00",
      "End": "17:30"
   }'

200 Response

{
   "ScheduleId": "string",
   "Name": "string",
   "Timezone": "America/Denver",
   "Days": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri"
   ],
   "Start": "08:00",
   "End": "17:30",
   "AgentIds": [
      "string"
   ],
   "Open": true,
   "UsedByAlerts": [
      {
         "AlertId": "string",
         "Name": "string"
      }
   ]
}

Request Body

Key Type Notes
Name string Required. Up to 100 characters.
Timezone string Required. e.g. America/Denver or UTC.
Days string array Required. Sun, Mon, Tue, Wed, Thu, Fri, Sat.
Start string Time the schedule opens, as HH:mm. Leave out Start and End to be open all day.
End string Time the schedule closes, as HH:mm. Use a time earlier than Start to run past midnight.
AgentIds string array Agents whose timelines show when this schedule opens and closes.

PUT

PUT /schedules/{scheduleId}

Replace a schedule's name, timezone, days, hours, and Agents. Every Alert that uses it follows the new hours.

curl -X 'PUT' \
   'https://yoursubdomain.api.pingplotter.cloud/schedules/{scheduleId}' \
   -H 'accept: application/json' \
   -H 'X-API-KEY: your_api_token' \
   -H 'Content-Type: application/json' \
   -d '{
      "Name": "Business hours",
      "Timezone": "America/Denver",
      "Days": [
         "Mon",
         "Tue",
         "Wed",
         "Thu",
         "Fri"
      ],
      "Start": "08:00",
      "End": "17:30"
   }'

200 Response

{
   "ScheduleId": "string",
   "Name": "string",
   "Timezone": "America/Denver",
   "Days": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri"
   ],
   "Start": "08:00",
   "End": "17:30",
   "AgentIds": [
      "string"
   ],
   "Open": true,
   "UsedByAlerts": [
      {
         "AlertId": "string",
         "Name": "string"
      }
   ]
}

Request Body

Key Type Notes
Name string Required. Up to 100 characters.
Timezone string Required. e.g. America/Denver or UTC.
Days string array Required. Sun, Mon, Tue, Wed, Thu, Fri, Sat.
Start string Time the schedule opens, as HH:mm. Leave out Start and End to be open all day.
End string Time the schedule closes, as HH:mm. Use a time earlier than Start to run past midnight.
AgentIds string array Agents whose timelines show when this schedule opens and closes.

DELETE

DELETE /schedules/{scheduleId}

Delete a schedule. This is refused while Alerts use it, unless force is true. An Alert whose only schedule is deleted notifies at any time.

curl -X 'DELETE' \
   'https://yoursubdomain.api.pingplotter.cloud/schedules/{scheduleId}?force=false' \
   -H 'accept: application/json' \
   -H 'X-API-KEY: your_api_token'

200 Response

{
   "ScheduleId": "string",
   "Name": "string",
   "Timezone": "America/Denver",
   "Days": [
      "Mon",
      "Tue",
      "Wed",
      "Thu",
      "Fri"
   ],
   "Start": "08:00",
   "End": "17:30",
   "AgentIds": [
      "string"
   ],
   "Open": true,
   "UsedByAlerts": [
      {
         "AlertId": "string",
         "Name": "string"
      }
   ]
}

Query Parameters

Parameter Type Notes
force boolean Delete the schedule even if Alerts use it. Default: false.