Application Management

Maintenance windows API in Pingdom

This document describes how to pause/unpause uptime checks using API 3.1

First published date

6/18/2021 4:48 PM

Last published date

11/29/2021 3:58 PM

Overview

The Maintenance Windows article demonstrates how to automatically pause uptime checks during a scheduled maintenance Window. This document is essentially the same but uses the API version 3.1. Samples from this document are taken from our API documentation.

Product section

Pingdom

Cause

Maintenance window UI is only available for plans with Advanced Subscription or above. Here are some command-line options to pause/unpause checks via API, which is available to all subscription plans. 

Resolution

Pause an uptime check:
curl -X PUT https://api.pingdom.com/api/3.1/checks/<check_id> -H 'Authorization:Bearer <token_id>' -H "Content-Type: application/json" -d '{"paused": true}'
Pause all uptime checks:
curl -X PUT https://api.pingdom.com/api/3.1/checks -H 'Authorization:Bearer <token_id>' -H "Content-Type: application/json" -d '{"paused": true}'
Pause selected uptime checks:
curl -X PUT https://api.pingdom.com/api/3.1/checks -H 'Authorization:Bearer <token_id>' -H "Content-Type: application/json" -d '{"checkids": "check_id_1, check_id_2", "paused": true}'
To unpause a check, set:
{"paused": false}
To view the status of an uptime check:
curl -X GET https://api.pingdom.com/api/3.1/checks/<check_id> -H 'Authorization:Bearer <token_id>' | grep "status"
To view all active (running) maintenance:
curl -X GET -H 'Authorization:Bearer token' https://api.pingdom.com/api/3.1/maintenance.occurrences