Go to All Forums

Scheduling Maintenance "now" with API

I am working on a deployment plan to deploy updates to a website.  I want to be able to put my website monitor in maintenance using the API.  I have examined the API and I know I can use a variaty of methods to make the API call.  What I am trying to figure out is a way to do this:

Step 1: API Call that will put the targeted monitor in maintenance mode "starting now" and lasting for 5 minutes.

Step 2: CI - Script Deploy application changes which will restart the web application

Step 3: API Call that will cancel the maintenance mode if the website comes back up before the 5 minutes has passed.


The step 3 is not going to be critical.  More of a "nice to have".  

The challenge is to figure out how to tell the API the date and time.  Hoping someone can give me some insight into ways to accomplish this.

Like (3) Reply
Replies (4)

Hi Laurie,

I hope you had a look at our API documentation on this:


You may need to create Once Only maintenance to achieve your requirement.


We are going to work on enhancing scheduled maintenance support in Site24x7. We will be supporting an API with which one can schedule ad-hoc maintenance. One can call "Start Maintenance" API to start the maintenance now and "End Maintenance" to end a currently running maintenance.

We will keep our forums updated on this.


Like (0) Reply

Hi Raghavan,

That is a good addition. Right now, the only way to achieve setting maintenance without a pre-determined time frame, is by suspending and activating the account. But the drawback is that if the monitor was already in scheduled maintenance, it does not return to maintenance.

So thumbs up for ad-hoc maintenance!

Like (0) Reply

Is this done and available please? Thank you!

Like (0) Reply

It's possible:

The endpoint names are a little misleading, though. You're setting the "immediate" maintenance window based on either the id or names of the monitors or monitor groups.

Using these endpoints creates maintenance windows of the display name "Ad hoc maintenance," and there is no way supply the display_name, unfortunately. As an enhancement request, I've asked for a display_name parameter for these APIs to rectify that. (I'm not sure if it will be accepted.)

Like (0) Reply

Was this post helpful?