# UptimeRobot REST API.

UptimeRobot has an easy-to-use API. Responses are provided as **XML, JSON or JSON-P**. It lets you get the details of your monitors, logs, create / edit / delete monitors, alert contacts and maintenance windows. That's all.

[Subscribe to get API updates](https://uptimerobot.com/dashboard?open=mySettings#mySettings "Click to subscribe")

API version: 2.0

- [Authentication](https://uptimerobot.com/api/legacy/#auth)
- [Formats](https://uptimerobot.com/api/legacy/#formats)
- [Methods](https://uptimerobot.com/api/legacy/#methods)
  - [POST getAccountDetails](https://uptimerobot.com/api/legacy/#getAccountDetailsWrap)
  - [POST getMonitors](https://uptimerobot.com/api/legacy/#getMonitorsWrap)
  - [POST newMonitor](https://uptimerobot.com/api/legacy/#newMonitorWrap)
  - [POST editMonitor](https://uptimerobot.com/api/legacy/#editMonitorWrap)
  - [POST deleteMonitor](https://uptimerobot.com/api/legacy/#deleteMonitorWrap)
  - [POST resetMonitor](https://uptimerobot.com/api/legacy/#resetMonitorWrap)
  - [POST getAlertContacts](https://uptimerobot.com/api/legacy/#getAlertContactsWrap)
  - [POST newAlertContact](https://uptimerobot.com/api/legacy/#newAlertContactWrap)
  - [POST editAlertContact](https://uptimerobot.com/api/legacy/#editAlertContactWrap)
  - [POST deleteAlertContact](https://uptimerobot.com/api/legacy/#deleteAlertContactWrap)
  - [POST getMWindows](https://uptimerobot.com/api/legacy/#getMWindowsWrap)
  - [POST newMWindow](https://uptimerobot.com/api/legacy/#newMWindowWrap)
  - [POST editMWindow](https://uptimerobot.com/api/legacy/#editMWindowWrap)
  - [POST deleteMWindow](https://uptimerobot.com/api/legacy/#deleteMWindowWrap)
  - [POST getPSPs](https://uptimerobot.com/api/legacy/#getPSPsWrap)
  - [POST newPSP](https://uptimerobot.com/api/legacy/#newPSPWrap)
  - [POST editPSP](https://uptimerobot.com/api/legacy/#editPSPWrap)
  - [POST deletePSP](https://uptimerobot.com/api/legacy/#deletePSPWrap)
- [Parameters](https://uptimerobot.com/api/legacy/#parameters)

## Authentication

HTTP Basic Access Authentication is used for verifying accounts.

There are 3 types of api\_keys for reaching the data:

- **account-specific api\_key** which allows using all the API methods on all the monitors of an account
- **monitor-specific api\_keys** which allows using only the `getMonitors` method for the given monitor
- **read-only api\_key** which allows fetching data with all the **get\*** API endpoints

### Which api\_key type to use?

**account-specific api\_key** is good for pulling data for more than 1 monitors (like listing the stats of all monitors) and/or adding-editing-deleting monitors.

**monitor-specific api\_key** s are good for pulling data for a single monitor without revealing your main api\_key (account-specific api\_key). For ex: you can use monitor-specific api\_keys in client websites (so you'll still be able to pull data and the client will only be able to see the monitor-specific api\_key).

**read-only api\_key** is good for pulling data for listing. If you are not going to use create, update or delete methods, you can use read-only api-key.

### Where to find the api\_keys?

They are **found under "My Settings" page**.

While making a request, you must send the api\_key in your request's body. API key as a query parameter is only allowed for `getMonitors` endpoint:

`https://api.uptimerobot.com/v2/getMonitors?api_key=YOUR_API_KEY_HERE`

### Rate Limits

We are trying to prevent abusive use of our API. We have rate limits based on user plan.

`FREE plan : 10 req/min
PRO plan : monitor limit * 2 req/min ( with maximum value 5000 req/min )`

We will return 429 HTTP status code in the response from API, when you hit the rate limits. Also we will return common rate limit response headers in the response :

`X-RateLimit-Limit - your current rate limit
X-RateLimit-Remaining - number of calls left in current duration
X-RateLimit-Reset - time since epoch in seconds at which
the rate limiting period will end (or already ended)
Retry-After - Number of second after you should retry the call
`

### CORS

CORS headers are sent only for **get\*** API endpoints with monitor-specific and read-only API keys.

## Formats

Responses can either be **XML or JSON**. Just mention the preferred format as:

`https://api.uptimerobot.com/v2/methodName?format=xml`

or

`https://api.uptimerobot.com/v2/methodName?format=json`

In order to get a JSON-P response, the requests need to be sent with a parameter named `callback` like `callback=jsonpUptimeRobot` and the response will return as:

`jsonpUptimeRobot({...});`

## Methods

- [POST getAccountDetails](https://uptimerobot.com/#)

Account details (max number of monitors that can be added and number of up/down/paused monitors) can be grabbed using this method.

#### Parameters

| Parameter | Description |
| --- | --- |
| **api\_key** | _required_\- Your API key. |

The URL for the request would be:

`https://api.uptimerobot.com/v2/getAccountDetails`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```plaintext
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json' "https://api.uptimerobot.com/v2/getAccountDetails"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/getAccountDetails",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json",
     CURLOPT_HTTPHEADER => array(
         "cache-control: no-cache",
         "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/getAccountDetails');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
     'content-type' => 'application/x-www-form-urlencoded',
     'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
     'api_key' => 'enterYourAPIKeyHere',
     'format' => 'json'
                                                   ));

try {
     $response = $request->send();
     echo $response->getBody();
                                                   } catch (HttpException $ex) {
     echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
                                                   }

conn.request("POST", "/v2/getAccountDetails", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/getAccountDetails"

payload = "api_key=enterYourAPIKeyHere&format=json"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
                                                   }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
     "method": "POST",
     "hostname": "api.uptimerobot.com",
     "port": null,
     "path": "/v2/getAccountDetails",
     "headers": {
         "cache-control": "no-cache",
         "content-type": "application/x-www-form-urlencoded"
     }
                                                   };

var req = http.request(options, function (res) {
     var chunks = [];

res.on("data", function (chunk) {
         chunks.push(chunk);
     });

res.on("end", function () {
         var body = Buffer.concat(chunks);
         console.log(body.toString());
     });
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json' }));
                                                   req.end();
```

```js
var request = require("request");

var options = {
     method: 'POST',
     url: 'https://api.uptimerobot.com/v2/getAccountDetails',
     headers:
     {
         'content-type': 'application/x-www-form-urlencoded',
         'cache-control': 'no-cache'
     },
     form: {
         api_key: 'enterYourAPIKeyHere',
         format: 'json'
     }
                                                   };

request(options, function (error, response, body) {
     if (error) throw new Error(error);
     console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/getAccountDetails"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/getAccountDetails");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/getAccountDetails")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json");
                                                   Request request = new Request.Builder()
                                                   .url("https://api.uptimerobot.com/v2/getAccountDetails")
                                                   .post(body)
                                                   .addHeader("cache-control", "no-cache")
                                                   .addHeader("content-type", "application/x-www-form-urlencoded")
                                                   .build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
 "stat": "ok",
 "account": {
     "email": "test@domain.com",
     "monitor_limit": 50,
     "monitor_interval": 1,
     "up_monitors": 1,
     "down_monitors": 0,
     "paused_monitors": 2
 }
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
                                                 <account id="1" email="test@domain.com" monitor_limit="50" monitor_interval="1" up_monitors="1" down_monitors="0" paused_monitors="2"/>
```

- [POST getMonitors](https://uptimerobot.com/#)

This is a Swiss-Army knife type of a method for **getting any information on monitors**.

By default, it lists all the monitors in a user's account, their friendly names, types (http, keyword, port, etc.), statuses (up, down, etc.) and uptime ratios.

There are optional parameters which lets the `getMonitors` method to output information on any given monitors rather than all of them.

And also, parameters exist for getting the notification logs (alerts) for each monitor and even which alert contacts were alerted on each notification.

#### Parameters

| Parameter | Description |
| --- | --- |
| **api\_key** | required |
| **monitors** | _optional_ (if not used, will return all monitors in an account. Else, it is possible to define any number of monitors with their IDs like: `monitors=15830-32696-83920`) |
| **types** | _optional_ (if not used, will return all monitors types (HTTP, keyword, ping..) in an account. Else, it is possible to define any number of monitor types like: `types=1-3-4`) |
| **statuses** | _optional_ (if not used, will return all monitors statuses (up, down, paused) in an account. Else, it is possible to define any number of monitor statuses like: `statuses=2-9`) |
| **custom\_uptime\_ratios** | _optional_ (defines the number of days to calculate the uptime ratio(s) for. Ex: `custom_uptime_ratios=7-30-45` to get the uptime ratios for those periods) |
| **custom\_down\_durations** | _optional_ (returns the "custom down durations" for given periods in "custom\_uptime\_ratios") |
| **custom\_uptime\_ranges** | _optional_ (defines the ranges to calculate the uptime ratio(s) for. Ex: `custom_uptime_ranges=1465440758_1466304758` to get the uptime ratios for those periods. It is possible to send multiple ranges like `1465440758_1466304758-1434682358_1434855158`) |
| **all\_time\_uptime\_ratio** | _optional_ (returns the "all time uptime ratio". It will slow down the response a bit and, if not really necessary, suggest not using it. Default is `0`) |
| **all\_time\_uptime\_durations** | _optional_ (returns the "all time durations of up-down-paused events". It will slow down the response a bit and, if not really necessary, suggest not using it. Default is `0`) |
| **logs** | _optional_ (defines if the logs of each monitor will be returned. Should be set to `1` for getting the logs. Default is `0`) |
| **logs\_start\_date** | _optional_ (works only for the Pro Plan as 24 hour+ logs are kept only in the Pro Plan, formatted as `Unix time` and must be used with `logs_end_date`) |
| **logs\_end\_date** | _optional_ (works only for the Pro Plan as 24 hour+ logs are kept only in the Pro Plan, formatted as `Unix time` and must be used with `logs_start_date`) |
| **log\_types** | _optional_ (the types of logs to be returned with a usage like: `log_types=1-2-98`). If empty, all log types are returned. |
| **logs\_limit** | _optional_ (the number of logs to be returned in descending order). If empty, all logs are returned. |
| **response\_times** | _optional_ (defines if the response time data of each monitor will be returned. Should be set to `1` for getting them. Default is `0`) |
| **response\_times\_limit** | _optional_ (the number of response time logs to be returned (descending order). If empty, last 24 hours of logs are returned (if `response_times_start_date` and `response_times_end_date` are not used). |
| **response\_times\_average** | _optional_ (by default, response time value of each check is returned. The API can return average values in given minutes. Default is `0`. For ex: the UptimeRobot dashboard displays the data averaged/grouped in 30 minutes) |
| **response\_times\_start\_date** | _optional_ (formatted as `Unix time` and must be used with `response_times_end_date`) (`response_times_end_date - response_times_start_date` can't be more than 7 days) |
| **response\_times\_end\_date** | _optional_ (formatted as `Unix time` and must be used with `response_times_start_date`) (`response_times_end_date - response_times_start_date` can't be more than 7 days) |
| **alert\_contacts** | _optional_ (defines if the alert contacts set for the monitor to be returned. Default is `0`.) |
| **mwindows** | _optional_ (defines if the maintenance windows for the monitors will be returned. Default is `0`.) |
| **ssl** | _optional_ (defines if SSL certificate info for each monitor will be returned) |
| **custom\_http\_headers** | _optional_ (defines if the custom HTTP headers of each monitor will be returned. Should be set to `1` for getting them. Default is `0`) |
| **custom\_http\_statuses** | _optional_ (defines if the custom HTTP statuses of each monitor will be returned. Should be set to `1` for getting them. Default is `0`) |
| **http\_request\_details** | _optional_ (defines if the request method type of each monitor will be returned. Should be set to `true` for getting them. Default is `false`) |
| **auth\_type** | _optional_ (defines if the auth type of each monitor will be returned. Should be set to `true` for getting them. Default is `false`) |
| **timezone** | _optional_ (defines if the user's timezone should be returned. Should be set to `1` for getting it. Default is `0`) |
| **offset** | _optional_ (used for pagination. Defines the record to start paginating. Default is `0`) |
| **limit** | _optional_ (used for pagination. Defines the max number of records to return for the response. Default and max. is `50`) |
| **search** | _optional_ (a keyword of your choice to search within `url` and `friendly_name` and get filtered results) |

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```plaintext
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'api_key=enterYourAPIKeyHere&format=json&logs=1' "https://api.uptimerobot.com/v2/getMonitors"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/getMonitors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&logs=1",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/getMonitors');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'cache-control' => 'no-cache',
'content-type' => 'application/x-www-form-urlencoded'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'logs' => '1'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
     }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")
                                                   payload = "api_key=enterYourAPIKeyHere&format=json&logs=1"

headers = {
     'content-type': "application/x-www-form-urlencoded",
     'cache-control': "no-cache"
     }

conn.request("POST", "/v2/getMonitors", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/getMonitors"

payload = "api_key=enterYourAPIKeyHere&format=json&logs=1"
                                                   headers = {
     'content-type': "application/x-www-form-urlencoded",
     'cache-control': "no-cache"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/getMonitors",
"headers": {
     "content-type": "application/x-www-form-urlencoded",
     "cache-control": "no-cache"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json', logs: '1' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/getMonitors',
headers:
    { 'cache-control': 'no-cache',
      'content-type': 'application/x-www-form-urlencoded' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json', logs: '1' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/getMonitors"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&logs=1")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("content-type", "application/x-www-form-urlencoded")
     req.Header.Add("cache-control", "no-cache")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/getMonitors");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&logs=1", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/getMonitors")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request["cache-control"] = 'no-cache'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&logs=1"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&logs=1");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/getMonitors")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.addHeader("cache-control", "no-cache")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
 "stat": "ok",
 "pagination": {
   "offset": 0,
   "limit": 50,
   "total": 2
 },
 "monitors": [\
   {\
     "id": 777749809,\
     "friendly_name": "Google",\
     "url": "http://www.google.com",\
     "type": 1,\
     "sub_type": "",\
     "keyword_type": "",\
     "keyword_case_type": "",\
     "keyword_value": "",\
     "http_username": "",\
     "http_password": "",\
     "port": "",\
     "interval": 900,\
     "status": 1,\
           "create_datetime": 1462565497,\
     "monitor_group": 0,\
     "is_group_main": 0,\
     "logs": [\
       {\
         "type": 98,\
         "datetime": 1463540297,\
         "duration": 1054134\
       }\
     ]\
   },\
   {\
     "id": 777712827,\
     "friendly_name": "My Web Page",\
     "url": "http://mywebpage.com/",\
     "type": 1,\
     "sub_type": "",\
     "keyword_type": "",\
     "keyword_case_type": "",\
     "keyword_value": "",\
     "http_username": "",\
     "http_password": "",\
     "port": "",\
     "interval": 60,\
     "status": 2,\
           "create_datetime": 1462465496,\
     "monitor_group": 0,\
     "is_group_main": 0,\
     "logs": [\
       {\
         "type": 98,\
         "datetime": 1462465202,\
         "duration": 32\
       },\
       {\
         "type": 1,\
         "datetime": 1462465234,\
         "duration": 490140\
       },\
       {\
         "type": 2,\
         "datetime": 1462955374,\
         "duration": 85\
       },\
       {\
         "type": 99,\
         "datetime": 1462955588,\
         "duration": 12\
       },\
       {\
         "type": 98,\
         "datetime": 1462955600,\
         "duration": 22\
       }\
     ]\
   }\
 ]
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
   <monitors stat="ok">
       <pagination offset="0" limit="50" total="2"/>
       <monitor id="777749809" friendly_name="Google" url="http://www.google.com" type="1" sub_type="" keyword_type="" keyword_case_type=""keyword_value="" http_username="" http_password="" port="" interval="900" status="1" create_datetime="1462565497"  monitor_group="0" is_group_main="0">
           <logs>
               <log type="98" datetime="1463540297" duration="1053736" alert_contacts=""/>
           </logs>
       </monitor>
       <monitor id="777712827" friendly_name="My Web Page" url="http://mywebpage.com/" type="1" sub_type="" keyword_type="" keyword_case_type=""keyword_value="" http_username="" http_password="" port="" interval="60" status="2" create_datetime="1462465496" monitor_group="0" is_group_main="0">
           <logs>
               <log type="98" datetime="1462465202" duration="32" alert_contacts=""/>
               <log type="2" datetime="1462955374" duration="85" alert_contacts=""/>
               <log type="1" datetime="1462955459" duration="34" alert_contacts=""/>
               <log type="99" datetime="1462955588" duration="12" alert_contacts=""/>
               <log type="98" datetime="1462955600" duration="22" alert_contacts=""/>
           </logs>
       </monitor>
   </monitors>
```

- [POST newMonitor](https://uptimerobot.com/#)

New monitors of any type can be created using this method.

#### Parameters

(must be sent as a JSON object)

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **friendly\_name** | _required_ |
| **url** | _required_ |
| **type** | _required_ |
| **sub\_type** | _optional_ ( _required_ for port monitoring) |
| **port** | _optional_ ( _required_ for port monitoring) |
| **keyword\_type** | _optional_ ( _required_ for keyword monitoring) |
| **keyword\_case\_type** | _optional_ (for keyword monitoring) |
| **keyword\_value** | _optional_ ( _required_ for keyword monitoring) |
| **interval** | _optional_ (in seconds) |
| **timeout** | _optional_ (in seconds, between 1 to 60) (for only HTTP, keyword, port monitor types) |
| **http\_username** | _optional_ |
| **http\_password** | _optional_ |
| **http\_auth\_type** | _optional_ (1 for HTTP Basic, 2 for Digest) |
| **post\_type** | _optional_ (key-value or raw data) |
| **post\_value** | _optional_ |
| **http\_method** | _optional_ |
| **post\_content\_type** | _optional_ |
| **alert\_contacts** | _optional_ (the alert contacts to be notified when the monitor goes up/down.Multiple `alert_contact>id`s can be sent like `alert_contacts=457_0_0-373_5_0-8956_2_3` where `alert_contact>ids` are seperated with - and `threshold` \+ `recurrence` are seperated with \_. For ex: `alert_contacts=457_5_0` refers to 457 being the `alert_contact>id`, 5 being the `threshold` and 0 being the `recurrence`. As the threshold and recurrence is only available in the paid plans, they are always 0 in the Free Plan) |
| **mwindows** | _optional_ (the maintenance windows for the monitor which can be mentioned with their IDs like 345-2986-71) |
| **custom\_http\_headers** | _optional_ (must be sent as a JSON object) |
| **custom\_http\_statuses** | _optional_ (must be sent as 404:0\_200:1 to accept 404 as down and 200 as up) |
| **ignore\_ssl\_errors** | _optional_ (for ignoring SSL certificate related errors) |
| **disable\_domain\_expire\_notifications** | _optional_ (0 for enable, 1 for disable, available only on http and keyword monitors) |

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&type=1&url=http://myMonitorURL.com&friendly_name=My Monitor' "https://api.uptimerobot.com/v2/newMonitor"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/newMonitor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/newMonitor');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'type' => '1',
'url' => 'http://myMonitorURL.com',
'friendly_name' => 'My Monitor'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/newMonitor", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/newMonitor"

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/newMonitor",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
type: '1',
url: 'http://myMonitorURL.com',
friendly_name: 'My Monitor' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/newMonitor',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      type: '1',
      url: 'http://myMonitorURL.com',
      friendly_name: 'My Monitor' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/newMonitor"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/newMonitor");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/newMonitor")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&type=1&url=http%3A%2F%2FmyMonitorURL.com&friendly_name=My%20Monitor");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/newMonitor")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
     "stat": "ok",
     "monitor": {
       "id": 777810874,
       "status": 1
     }
   }
```

```xml
<?xml version="1.0" encoding="UTF-8"?><monitor status="1" id="777810882"/>
```

- [POST editMonitor](https://uptimerobot.com/#)

Monitors can be edited using this method.

**Important:** The type of a monitor can not be edited (like changing a HTTP monitor into a Port monitor). For such cases, deleting the monitor and re-creating a new one is adviced.

#### Parameters

(must be sent as a JSON object)

|     |     |
| --- | --- |
| **api\_key** | required |
| **id** | required (the ID of the monitor to be edited) |
| **friendly\_name** | optional |
| **url** | optional |
| **sub\_type** | optional |
| **port** | optional |
| **keyword\_type** | optional |
| **keyword\_case\_type** | optional |
| **keyword\_value** | optional |
| **interval** | optional (in seconds) |
| **timeout** | _optional_ (in seconds, between 1 to 60) (for only HTTP, keyword, port monitor types) |
| **status** | optional (0 for pause, 1 for resume) |
| **http\_username** | optional |
| **http\_password** | optional |
| **http\_auth\_type** | optional (1 for HTTP Basic, 2 for Digest) |
| **http\_method** | optional |
| **post\_type** | optional (key-value or raw data) |
| **post\_value** | optional |
| **post\_content\_type** | optional |
| **alert\_contacts** | optional (the alert contacts to be notified when the monitor goes up/down.Multiple `alert_contact>id`s can be sent like `alert_contacts=457_0_0-373_5_0-8956_2_3` where `alert_contact>id`s are seperated with - and `threshold` \+ `recurrence` are seperated with \_. For ex: `alert_contacts=457_5_0` refers to 457 being the `alert_contact>id`, 5 being the `threshold` and 0 being the `recurrence`. As the threshold and recurrence is only available in the Pro Plan, they are always 0 in the Free Plan) |
| **mwindows** | optional (the maintenance windows for the monitor which can be mentioned with their IDs like 345-2986-71) |
| **custom\_http\_headers** | optional (must be sent as a JSON object) |
| **custom\_http\_statuses** | optional (must be sent as 404:0\_200:1 to accept 404 as down and 200 as up) |
| **ignore\_ssl\_errors** | optional (for ignoring SSL certificate related errors) |
| **disable\_domain\_expire\_notifications** | _optional_ (0 for enable, 1 for disable, available only on http and keyword monitors) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/editMonitor`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName' "https://api.uptimerobot.com/v2/editMonitor"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/editMonitor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/editMonitor');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'id' => '777712827',
'friendly_name' => 'newFriendlyName'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/editMonitor", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/editMonitor"

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/editMonitor",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
id: '777712827',
friendly_name: 'newFriendlyName' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/editMonitor',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      id: '777712827',
      friendly_name: 'newFriendlyName' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/editMonitor"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/editMonitor");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/editMonitor")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=777712827&friendly_name=newFriendlyName");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/editMonitor")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{"stat":"ok","monitor":{"id":777712827}}
```

```xml
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
```

- [POST deleteMonitor](https://uptimerobot.com/#)

Monitors can be deleted using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **id** | _required_ (the ID of the monitor to be deleted) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/deleteMonitor`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=777712827' "https://api.uptimerobot.com/v2/deleteMonitor"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/deleteMonitor",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=777712827",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/deleteMonitor');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'id' => '777712827'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/deleteMonitor", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/deleteMonitor"

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/deleteMonitor",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
id: '777712827' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/deleteMonitor',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      id: '777712827' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/deleteMonitor"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&id=777712827")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/deleteMonitor");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=777712827", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/deleteMonitor")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&id=777712827"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=777712827");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/deleteMonitor")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{"stat":"ok","monitor":{"id":777712827}}
```

```xml
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
```

- [POST resetMonitor](https://uptimerobot.com/#)

Monitors can be reset (deleting all stats and response time data) using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **id** | _required_ (the ID of the monitor to be reseted) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/resetMonitor`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=777712827' "https://api.uptimerobot.com/v2/resetMonitor"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/resetMonitor",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=777712827",
     CURLOPT_HTTPHEADER => array(
         "cache-control: no-cache",
         "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/resetMonitor');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
     'content-type' => 'application/x-www-form-urlencoded',
     'cache-control' => 'no-cache'
                                                   ));

try {
     $response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
     echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827"

headers = {
         'cache-control': "no-cache",
         'content-type': "application/x-www-form-urlencoded"
         }

conn.request("POST", "/v2/resetMonitor", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/resetMonitor"

payload = "api_key=enterYourAPIKeyHere&format=json&id=777712827"
                                                   headers = {
         'cache-control': "no-cache",
         'content-type': "application/x-www-form-urlencoded"
         }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
     "method": "POST",
     "hostname": "api.uptimerobot.com",
     "port": null,
     "path": "/v2/resetMonitor",
     "headers": {
         "cache-control": "no-cache",
         "content-type": "application/x-www-form-urlencoded"
     }
                                                   };

var req = http.request(options, function (res) {
     var chunks = [];

res.on("data", function (chunk) {
         chunks.push(chunk);
     });

res.on("end", function () {
         var body = Buffer.concat(chunks);
         console.log(body.toString());
     });
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
     format: 'json',
     id: '777712827' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
     url: 'https://api.uptimerobot.com/v2/resetMonitor',
     headers:
      { 'content-type': 'application/x-www-form-urlencoded',
          'cache-control': 'no-cache' },
     form:
      { api_key: 'enterYourAPIKeyHere',
          format: 'json',
          id: '777712827' } };

request(options, function (error, response, body) {
     if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/resetMonitor"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&id=777712827")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/resetMonitor");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=777712827", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/resetMonitor")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=777712827");
                                                   Request request = new Request.Builder()
     .url("https://api.uptimerobot.com/v2/resetMonitor")
     .post(body)
     .addHeader("cache-control", "no-cache")
     .addHeader("content-type", "application/x-www-form-urlencoded")
     .build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
   "stat":"ok",
   "monitor": {
       "id": 777712827
   }
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
```

- [POST getAlertContacts](https://uptimerobot.com/#)

The list of alert contacts can be called with this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **alert\_contacts** | _optional_ (if not used, will return all alert contacts in an account. Else, it is possible to define any number of alert contacts with their IDs like: `alert_contacts=236-1782-4790`) |
| **offset** | _optional_ (used for pagination. Defines the record to start paginating. Default is `0`) |
| **limit** | _optional_ (used for pagination. Defines the max number of records to return for the response. Default and max. is `50`) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/getAlertContacts`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json' "https://api.uptimerobot.com/v2/getAlertContacts"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/getAlertContacts",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json",
     CURLOPT_HTTPHEADER => array(
         "cache-control: no-cache",
         "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/getAlertContacts');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/getAlertContacts", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/getAlertContacts"

payload = "api_key=enterYourAPIKeyHere&format=json"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/getAlertContacts",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/getAlertContacts',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/getAlertContacts"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/getAlertContacts");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/getAlertContacts")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/getAlertContacts")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
 "stat": "ok",
 "limit": 50,
 "offset": 0,
 "total": 2,
 "alert_contacts": [\
   {\
     "id": "0993765",\
     "friendly_name": "John Doe",\
     "type": 2,\
     "status": 1,\
     "value": "johndoe@gmail.com"\
   },\
   {\
     "id": "2403924",\
     "friendly_name": "My Twitter",\
     "type": 3,\
     "status": 0,\
     "value": "sampleTwitterAccount"\
   }\
 ]
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
                                                 <alert_contacts offset="0" limit="50" total="2">
   <alert_contact id="0993765" friendly_name="John Doe" type="2" status="1" value="johndoe@gmail.com"/>
   <alert_contact id="2403924" friendly_name="My Twitter" type="3" status="0" value="sampleTwitterAccount"/>
                                                 </alert_contacts>
```

- [POST newAlertContact](https://uptimerobot.com/#)

New alert contacts of any type ( **SMS/pro-SMS and voice-call alert contacts are deprecated**) can be created using this method.

The alert contacts created using the API are validated with the same way as they were created from uptimerobot.com (activation link for e-mails, etc.).

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **type** | _required_ |
| **value** | _required_ |
| **friendly\_name** | _optional_ |

The URL for the request would be:

`https://api.uptimerobot.com/v2/newAlertContact`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My Alert Contact&value=test@mydomain.com' "https://api.uptimerobot.com/v2/newAlertContact"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/newAlertContact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/newAlertContact');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'type' => '1',
'friendly_name' => 'My Alert Contact',
'value' => 'test@mydomain.com'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/newAlertContact", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/newAlertContact"

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/newAlertContact",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
type: '1',
friendly_name: 'My Alert Contact',
value: 'test@mydomain.com' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/newAlertContact',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      type: '1',
      friendly_name: 'My Alert Contact',
      value: 'test@mydomain.com' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/newAlertContact"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/newAlertContact");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/newAlertContact")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Alert%20Contact&value=test%40mydomain.com");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/newAlertContact")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "alertcontact": {
       "id": "4561",
       "status": "0"
   }
                                                 })
```

```xml
<alertcontact id="236" status="2"/></alertcontact>
```

- [POST editAlertContact](https://uptimerobot.com/#)

Alert contacts can be edited using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **id** | _required_ |
| **friendly\_name** | _optional_ |
| **value** | _optional_ (can only be used if it is a web-hook alert contact) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/editAlertContact`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&friendly_name=New Name For Alert Contact&id=236&=' "https://api.uptimerobot.com/v2/editAlertContact"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/editAlertContact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&=",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/editAlertContact');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'friendly_name' => 'New Name For Alert Contact',
'id' => '236',
'' => ''
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&="

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/editAlertContact", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/editAlertContact"

payload = "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&="
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/editAlertContact",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
friendly_name: 'New Name For Alert Contact',
id: '236',
'': '' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/editAlertContact',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      friendly_name: 'New Name For Alert Contact',
      id: '236',
      '': '' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/editAlertContact"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&=")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/editAlertContact");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&=", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/editAlertContact")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&="

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&friendly_name=New%20Name%20For%20Alert%20Contact&id=236&=");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/editAlertContact")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "alertcontact": {
       "id": "236"
   }
                                                 })
```

```xml
<alertcontact id="236"/></alertcontact>
```

- [POST deleteAlertContact](https://uptimerobot.com/#)

Alert contacts can be deleted using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **id** | _required_ |

The URL for the request would be:

`https://api.uptimerobot.com/v2/deleteAlertContact`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=2414745' "https://api.uptimerobot.com/v2/deleteAlertContact"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/deleteAlertContact",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=2414745",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/deleteAlertContact');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'id' => '2414745'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=2414745"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/deleteAlertContact", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/deleteAlertContact"

payload = "api_key=enterYourAPIKeyHere&format=json&id=2414745"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/deleteAlertContact",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json', id: '2414745' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/deleteAlertContact',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json', id: '2414745' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
var request = require("request");

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/deleteAlertContact");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=2414745", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/deleteAlertContact")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&id=2414745"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=2414745");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/deleteAlertContact")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "alert_contact": {
       "id": "236"
   }
                                                 })
```

```xml
<alertcontact id="236"/></alertcontact>
```

- [POST getMWindows](https://uptimerobot.com/#)

The list of maintenance windows can be called with this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **mwindows** | _optional_ (if not used, will return all mwindows in an account. Else, it is possible to define any number of mwindows with their IDs like: `mwindows=236-1782-4790`) |
| **offset** | _optional_ (used for pagination. Defines the record to start paginating. Default is `0`) |
| **limit** | _optional_ (used for pagination. Defines the max number of records to return for the response. Default and max. is `50`) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/getMWindows`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json' "https://api.uptimerobot.com/v2/getMWindows"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/getMWindows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/getMWindows');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/getMWindows", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/getMWindows"

payload = "api_key=enterYourAPIKeyHere&format=json"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/getMWindows",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/getMWindows',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/getMWindows"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/getMWindows");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/getMWindows")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/getMWindows")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
 "stat": "ok",
 "pagination": {
   "limit": 10,
   "offset": 0,
   "total": 3
 },
 "mwindows": [\
   {\
     "id": 581,\
     "user": 1,\
     "type": 1,\
     "friendly_name": "Once Backup",\
     "start_time": 1461024000,\
     "duration": 12,\
     "value": "",\
     "status": 1\
   },\
   {\
     "id": 582,\
     "user": 1,\
     "type": 2,\
     "friendly_name": "Daily Reboot",\
     "start_time": "06:37",\
     "duration": 2,\
     "value": "",\
     "status": 1\
   }\
 ]
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
                                                 <result>
   <pagination>
       <limit>10</limit>
       <offset>0</offset>
       <total>3</total>
   </pagination>
   <mwindows>
       <mwindow>
           <id>581</id>
           <user>1</user>
           <type>1</type>
           <friendly_name>Once Backup</friendly_name>
           <start_time>1461024000</start_time>
           <duration>12</duration>
           <value></value>
           <status>1</status>
       </mwindow>
       <mwindow>
           <id>582</id>
           <user>1</user>
           <type>2</type>
           <friendly_name>Daily Reboot</friendly_name>
           <start_time>06:37</start_time>
           <duration>2</duration>
           <value></value>
           <status>1</status>
       </mwindow>
   </mwindows>
                                                 </result>
```

- [POST newMWindow](https://uptimerobot.com/#)

New maintenance windows can be created using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **friendly\_name** | _required_ |
| **type** | _required_ |
| **value** | _required_ (only needed for weekly and monthly maintenance windows and must be sent like 2-4-5 for Tuesday-Thursday-Friday or 10-17-26 for the days of the month) |
| **start\_time** | _required_ (the start datetime) |
| **duration** | _required_ (how many minutes the maintenance window will be active for) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/newMWindow`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&friendly_name=My Maintenance Window&type=1&start_time=1612083323&duration=30' "https://api.uptimerobot.com/v2/newMWindow"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/newMWindow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/newMWindow');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json',
'friendly_name' => 'My Maintenance Window',
'type' => '1',
'start_time' => '1612083323',
'duration' => '30'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/newMWindow", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/newMWindow"

payload = "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/newMWindow",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
format: 'json',
friendly_name: 'My Maintenance Window',
type: '1',
start_time: '1612083323',
duration: '30' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/newMWindow',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      friendly_name: 'My Maintenance Window',
      type: '1',
      start_time: '1612083323',
      duration: '30' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/newMWindow"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/newMWindow");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/newMWindow")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&friendly_name=My%20Maintenance%20Window&type=1&start_time=1612083323&duration=30");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/newMWindow")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

- [POST editMWindow](https://uptimerobot.com/#)

Maintenance windows can be edited using this method.

#### Parameters

The URL for the request would be:

`https://api.uptimerobot.com/v2/editMWindow`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New Name For mWindow&start_time=1613093323&duration=22' "https://api.uptimerobot.com/v2/editMWindow"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/editMWindow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/editMWindow');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'id' => '256',
'format' => 'json',
'friendly_name' => 'New Name For mWindow',
'start_time' => '1613093323',
'duration' => '22'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/editMWindow", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/editMWindow"

payload = "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/editMWindow",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
id: '256',
format: 'json',
friendly_name: 'New Name For mWindow',
start_time: '1613093323',
duration: '22' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/editMWindow',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form:
    { api_key: 'enterYourAPIKeyHere',
      id: '256',
      format: 'json',
      friendly_name: 'New Name For mWindow',
      start_time: '1613093323',
      duration: '22' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/editMWindow"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/editMWindow");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/editMWindow")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&id=256&format=json&friendly_name=New%20Name%20For%20mWindow&start_time=1613093323&duration=22");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/editMWindow")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```
{
 "stat": "ok",
 "mwindow": {
   "id": 256,
   "status": 1
 }
                                                 }
```

```
<?xml version="1.0" encoding="UTF-8"?><mwindow status="1" id="256"/>
```

- [POST deleteMWindow](https://uptimerobot.com/#)

Maintenance windows can be deleted using this method.

#### Parameters

|     |     |
| --- | --- |
| **id** | _required_ |
| **api\_key** | _required_ |

The URL for the request would be:

`https://api.uptimerobot.com/v2/deleteMWindow`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=2414745' "https://api.uptimerobot.com/v2/deleteMWindow"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.uptimerobot.com/v2/deleteMWindow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=2414745",
CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
                                                   } else {
echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/deleteMWindow');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=2414745"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/deleteMWindow", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/deleteMWindow"

payload = "api_key=enterYourAPIKeyHere&format=json&id=2414745"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/deleteMWindow",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json', id: '2414745' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/deleteMWindow',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json', id: '2414745' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/deleteMWindow"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&id=2414745")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/deleteMWindow");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=2414745", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/deleteMWindow")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=2414745");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/deleteMWindow")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "mwindow": {
       "id": "2414745"
   }
                                                 })
```

```xml
<?xml version="1.0" encoding="UTF-8"?><mwindow id="2414745"/>
```

- [POST getPSPs](https://uptimerobot.com/#)

The list of public status pages can be called with this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **psps** | _optional_ (if not used, will return all public status pages in an account. Else, it is possible to define any number of public status pages with their IDs like: `psps=236-1782-4790`) |
| **offset** | _optional_ (used for pagination. Defines the record to start paginating. Default is `0`) |
| **limit** | _optional_ (used for pagination. Defines the max number of records to return for the response. Default and max. is `50`) |

The URL for the request would be:

`https://api.uptimerobot.com/v2/getPSPs`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json' "https://api.uptimerobot.com/v2/getPSPs"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/getPSPs",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json",
     CURLOPT_HTTPHEADER => array(
         "cache-control: no-cache",
         "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/getPSPs');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
'content-type' => 'application/x-www-form-urlencoded',
'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
'api_key' => 'enterYourAPIKeyHere',
'format' => 'json'
                                                   ));

try {
$response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/getPSPs", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/getPSPs"

payload = "api_key=enterYourAPIKeyHere&format=json"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
"method": "POST",
"hostname": "api.uptimerobot.com",
"port": null,
"path": "/v2/getPSPs",
"headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
}
                                                   };

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
});

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
});
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
url: 'https://api.uptimerobot.com/v2/getPSPs',
headers:
    { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
form: { api_key: 'enterYourAPIKeyHere', format: 'json' } };

request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/getPSPs"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/getPSPs");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/getPSPs")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json");
                                                   Request request = new Request.Builder()
.url("https://api.uptimerobot.com/v2/getPSPs")
.post(body)
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
{
 "stat": "ok",
 "limit": 50,
 "offset": 0,
 "total": 2,
 "psps": [\
   {\
     "id": 76,\
     "friendly_name": "My Domain Status",\
     "monitors": 0,\
     "sort": 1,\
     "status": 1,\
     "standard_url": "https://stats.uptimerobot.com/Z7f2g",\
     "custom_url": "https://status.mydomain.com"\
   },\
   {\
     "id": 77,\
     "friendly_name": "Internal Status",\
     "monitors": 0,\
     "sort": 1,\
     "status": 1,\
     "standard_url": "https://stats.uptimerobot.com/a3x1e",\
     "custom_url": "https://test.oursite.com"\
   }\
 ]
                                                 }
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
                                                 <psps offset="0" limit="50" total="2">
   <psp id="76" friendly_name="My Domain Status" monitors="0" sort="1" status="1" standard_url="https://stats.uptimerobot.com/Z7f2g" custom_url="https://status.mydomain.com"/>
   <psp id="77" friendly_name="Internal Status" monitors="0" sort="1" status="1" standard_url="https://stats.uptimerobot.com/a3x1e" custom_url="https://test.oursite.com"/>
                                                 </psps>
```

- [POST newPSP](https://uptimerobot.com/#)

New public status pages can be created using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **type** | _required_ |
| **friendly\_name** | _required_ |
| **monitors** | _required_ (The monitors to be displayed can be sent as `15830-32696-83920`. Or `0` for displaying all monitors) |
| **custom\_domain** | _optional_ |
| **password** | _optional_ |
| **sort** | _optional_ |
| **hide\_url\_links** | _optional_ (for hiding the UptimeRobot links and only available in the Pro Plan) |
| **status** | _optional_ |

The URL for the request would be:

`https://api.uptimerobot.com/v2/newPSP`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My Status Page&monitors=15830-32696-83920' "https://api.uptimerobot.com/v2/newPSP"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/newPSP",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920",
     CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/newPSP');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
     'content-type' => 'application/x-www-form-urlencoded',
     'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
     'api_key' => 'enterYourAPIKeyHere',
     'format' => 'json',
     'type' => '1',
     'friendly_name' => 'My Status Page',
     'monitors' => '15830-32696-83920'
                                                   ));

try {
     $response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
     echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/newPSP", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/newPSP"

payload = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
     "method": "POST",
     "hostname": "api.uptimerobot.com",
     "port": null,
     "path": "/v2/newPSP",
     "headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
     }
                                                   };

var req = http.request(options, function (res) {
     var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
     });

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
     });
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
     format: 'json',
     type: '1',
     friendly_name: 'My Status Page',
     monitors: '15830-32696-83920' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
     url: 'https://api.uptimerobot.com/v2/newPSP',
     headers:
      { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
     form:
      { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      type: '1',
      friendly_name: 'My Status Page',
      monitors: '15830-32696-83920' } };

request(options, function (error, response, body) {
     if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/newPSP"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/newPSP");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/newPSP")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&type=1&friendly_name=My%20Status%20Page&monitors=15830-32696-83920");
                                                   Request request = new Request.Builder()
     .url("https://api.uptimerobot.com/v2/newPSP")
     .post(body)
     .addHeader("cache-control", "no-cache")
     .addHeader("content-type", "application/x-www-form-urlencoded")
     .build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "psp": {
       "id": "4561"
   }
                                                 })
```

```xml
<psp id="236" status="2"/></psp>
```

- [POST editPSP](https://uptimerobot.com/#)

Public status pages can be edited using this method.

#### Parameters

The URL for the request would be:

`https://api.uptimerobot.com/v2/editPSP`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New Name For Status Page&id=236&=' "https://api.uptimerobot.com/v2/editPSP"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/editPSP",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696",
     CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/editPSP');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
     'content-type' => 'application/x-www-form-urlencoded',
     'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
     'api_key' => 'enterYourAPIKeyHere',
     'format' => 'json',
     'id' => '495',
     'friendly_name' => 'New Name For Status Page',
     'monitors' => '15830-32696',
     '' => ''
                                                   ));

try {
     $response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
     echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/editPSP", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/editPSP"

payload = "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
     "method": "POST",
     "hostname": "api.uptimerobot.com",
     "port": null,
     "path": "/v2/editPSP",
     "headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
     }
                                                   };

var req = http.request(options, function (res) {
     var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
     });

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
     });
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere',
     format: 'json',
     id: '495',
     friendly_name: 'New Name For Status Page',
     monitors: '15830-32696',
     '': '' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
     url: 'https://api.uptimerobot.com/v2/editPSP',
     headers:
      { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
     form:
      { api_key: 'enterYourAPIKeyHere',
      format: 'json',
      id: '495',
      friendly_name: 'New Name For Status Page',
      monitors: '15830-32696',
      '': '' } };

request(options, function (error, response, body) {
     if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
package main

import (
     "fmt"
     "strings"
     "net/http"
     "io/ioutil"
                                                   )

func main() {

url := "https://api.uptimerobot.com/v2/editPSP"

payload := strings.NewReader("api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("cache-control", "no-cache")
     req.Header.Add("content-type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
     body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
     fmt.Println(string(body))

}
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/editPSP");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/editPSP")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=495&friendly_name=New%20Name%20For%20Status%20Page&monitors=15830-32696");
                                                   Request request = new Request.Builder()
     .url("https://api.uptimerobot.com/v2/editPSP")
     .post(body)
     .addHeader("cache-control", "no-cache")
     .addHeader("content-type", "application/x-www-form-urlencoded")
     .build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "psp": {
       "id": "4561"
   }
                                                 })
```

```xml
<psp id="236" status="2"/></psp>
```

- [POST deletePSP](https://uptimerobot.com/#)

Public status pages can be deleted using this method.

#### Parameters

|     |     |
| --- | --- |
| **api\_key** | _required_ |
| **id** | _required_ |

The URL for the request would be:

`https://api.uptimerobot.com/v2/deletePSP`

#### Example

cURLPHP cURLPHP httpRequestPython http.clientPython RequestsNode.js NativeNode.js RequestsGoC#RubyJava

```text
curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'api_key=enterYourAPIKeyHere&format=json&id=1256' "https://api.uptimerobot.com/v2/deletePSP"
```

```php
$curl = curl_init();

curl_setopt_array($curl, array(
     CURLOPT_URL => "https://api.uptimerobot.com/v2/deletePSP",
     CURLOPT_RETURNTRANSFER => true,
     CURLOPT_ENCODING => "",
     CURLOPT_MAXREDIRS => 10,
     CURLOPT_TIMEOUT => 30,
     CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
     CURLOPT_CUSTOMREQUEST => "POST",
     CURLOPT_POSTFIELDS => "api_key=enterYourAPIKeyHere&format=json&id=1256",
     CURLOPT_HTTPHEADER => array(
     "cache-control: no-cache",
     "content-type: application/x-www-form-urlencoded"
     ),
                                                   ));

$response = curl_exec($curl);
                                                   $err = curl_error($curl);

curl_close($curl);

if ($err) {
     echo "cURL Error #:" . $err;
                                                   } else {
     echo $response;
                                                   }
```

```php
$request = new HttpRequest();
                                                   $request->setUrl('https://api.uptimerobot.com/v2/deletePSP');
                                                   $request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
     'content-type' => 'application/x-www-form-urlencoded',
     'cache-control' => 'no-cache'
                                                   ));

$request->setContentType('application/x-www-form-urlencoded');
                                                   $request->setPostFields(array(
     'api_key' => 'enterYourAPIKeyHere',
     'format' => 'json',
     'id' => '1256'
                                                   ));

try {
     $response = $request->send();

echo $response->getBody();
                                                   } catch (HttpException $ex) {
     echo $ex;
                                                   }
```

```python
import http.client

conn = http.client.HTTPSConnection("api.uptimerobot.com")

payload = "api_key=enterYourAPIKeyHere&format=json&id=1256"

headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

conn.request("POST", "/v2/deletePSP", payload, headers)

res = conn.getresponse()
                                                   data = res.read()

print(data.decode("utf-8"))
```

```python
import requests

url = "https://api.uptimerobot.com/v2/deletePSP"

payload = "api_key=enterYourAPIKeyHere&format=json&id=1256"
                                                   headers = {
     'cache-control': "no-cache",
     'content-type': "application/x-www-form-urlencoded"
     }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
```

```js
var qs = require("querystring");
                                                   var http = require("https");

var options = {
     "method": "POST",
     "hostname": "api.uptimerobot.com",
     "port": null,
     "path": "/v2/deletePSP",
     "headers": {
     "cache-control": "no-cache",
     "content-type": "application/x-www-form-urlencoded"
     }
                                                   };

var req = http.request(options, function (res) {
     var chunks = [];

res.on("data", function (chunk) {
     chunks.push(chunk);
     });

res.on("end", function () {
     var body = Buffer.concat(chunks);
     console.log(body.toString());
     });
                                                   });

req.write(qs.stringify({ api_key: 'enterYourAPIKeyHere', format: 'json', id: '1256' }));
                                                   req.end();
```

```js
var request = require("request");

var options = { method: 'POST',
     url: 'https://api.uptimerobot.com/v2/deletePSP',
     headers:
      { 'content-type': 'application/x-www-form-urlencoded',
      'cache-control': 'no-cache' },
     form: { api_key: 'enterYourAPIKeyHere', format: 'json', id: '1256' } };

request(options, function (error, response, body) {
     if (error) throw new Error(error);

console.log(body);
                                                   });
```

```go
var request = require("request");

request(options, function (error, response, body) {
     if (error) throw new Error(error);

console.log(body);
                                                   });
```

```csharp
var client = new RestClient("https://api.uptimerobot.com/v2/deletePSP");
                                                   var request = new RestRequest(Method.POST);
                                                   request.AddHeader("content-type", "application/x-www-form-urlencoded");
                                                   request.AddHeader("cache-control", "no-cache");
                                                   request.AddParameter("application/x-www-form-urlencoded", "api_key=enterYourAPIKeyHere&format=json&id=1256", ParameterType.RequestBody);
                                                   IRestResponse response = client.Execute(request);
```

```ruby
require 'uri'
                                                   require 'net/http'

url = URI("https://api.uptimerobot.com/v2/deletePSP")

http = Net::HTTP.new(url.host, url.port)
                                                   http.use_ssl = true
                                                   http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
                                                   request["cache-control"] = 'no-cache'
                                                   request["content-type"] = 'application/x-www-form-urlencoded'
                                                   request.body = "api_key=enterYourAPIKeyHere&format=json&id=1256"

response = http.request(request)
                                                   puts response.read_body
```

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
                                                   RequestBody body = RequestBody.create(mediaType, "api_key=enterYourAPIKeyHere&format=json&id=1256");
                                                   Request request = new Request.Builder()
     .url("https://api.uptimerobot.com/v2/deletePSP")
     .post(body)
     .addHeader("cache-control", "no-cache")
     .addHeader("content-type", "application/x-www-form-urlencoded")
     .build();

Response response = client.newCall(request).execute();
```

#### Response

- [JSON](https://uptimerobot.com/#)
  - [XML](https://uptimerobot.com/#)

```json
jsonUptimeRobotApi({
   "stat": "ok",
   "psp": {
       "id": "236"
   }
                                                 })
```

```xml
<?xml version="1.0" encoding="UTF-8"?><psp id="1256"/>
```

## Parameters

All API parameters have to send inside the POST request's body.

| Objects | Values | Extra Details |
| --- | --- | --- |
| stat | - ok<br>- fail | exists only for JSON responses to show if any records are returned or not. |
| pagination>offset | integer | the starting record for `getMonitors` and `getAlertContacts` methods |
| pagination>limit | integer | the number of records to be returned for `getMonitors` and `getAlertContacts` methods |
| pagination>total | integer | the total number of records for `getMonitors` and `getAlertContacts` methods |
| account>email | text | the account e-mail. |
| account>monitor\_limit | integer | the max number of monitors that can be created for the account |
| account>monitor\_interval | integer | the min monitoring interval (in seconds) supported by the account |
| account>up\_monitors | integer | the number of "up" monitors |
| account>down\_monitors | integer | the number of "down" monitors |
| account>pause\_monitors | integer | the number of "paused" monitors |
| monitor>id | integer | the ID of the monitor (can be used for monitor-specific requests). |
| monitor>friendly\_name | text | the friendly name of the monitor. |
| monitor>url | URL or IP | the URL/IP of the monitor. |
| monitor>monitor\_interval | integer | timeout duration for monitoring check. Used only for only HTTP, keyword, port monitor types (in seconds between 1 to 60, default 30) |
| monitor>type | - 1 - HTTP(s)<br>- 2 - Keyword<br>- 3 - Ping<br>- 4 - Port<br>- 5 - Heartbeat | the type of the monitor. |
| monitor>sub\_type | - 1 - HTTP (80)<br>- 2 - HTTPS (443)<br>- 3 - FTP (21)<br>- 4 - SMTP (25)<br>- 5 - POP3 (110)<br>- 6 - IMAP (143)<br>- 99 - Custom Port | used only for "Port monitoring (monitor>type = 4)" and shows which pre-defined port/service is monitored or if a custom port is monitored. |
| monitor>keyword\_type | - 1 - exists<br>- 2 - not exists | used only for "Keyword monitoring (monitor>type = 2)" and shows "if the monitor will be flagged as down when the keyword exists or not exists". |
| monitor>keyword\_case\_type | - 0 - case sensitive<br>- 1 - case insensitive | used only for "Keyword monitoring (monitor>type = 2)" if set the keyword value will be checked as case sensitive or case insensitive according the selection. (case sensitive by default) |
| monitor>keyword\_value | text | the value of the keyword. |
| monitor>http\_username | text | used for password-protected web pages. Available for HTTP and keyword monitoring. |
| monitor>http\_password | text | used for password-protected web pages. Available for HTTP and keyword monitoring. |
| monitor>http\_auth\_type | - 1 - HTTP Basic Auth<br>- 2 - Digest | used for password-protected web pages. Available for HTTP and keyword monitoring |
| monitor>port | integer | used only for "Port monitoring (monitor>type = 4)" and shows the port monitored. |
| monitor>interval | integer | the interval for the monitoring check (300 seconds by default). |
| monitor>status | - 0 - paused<br>- 1 - not checked yet<br>- 2 - up<br>- 8 - seems down<br>- 9 - down | the status of the monitor. When used with the editMonitor method 0 (to pause) or 1 (to start) can be sent. |
| monitor>all\_time\_uptime\_ratio | formatted as up-down-paused | the uptime ratio of the monitor calculated since the monitor is created. |
| monitor>all\_time\_uptime\_durations | rational number (with 3 decimals) | the durations of all time up-down-paused events in seconds. |
| monitor>custom\_uptime\_ratios | rational number (with 3 decimals) | the uptime ratio of the monitor for the given periods (if there is more than 1 period, then the values are seperated with "-") |
| monitor>custom\_down\_durations | rational number (with 3 decimals) | the down durations of the monitor for the given periods in seconds(if there is more than 1 period, then the values are seperated with "-") |
| monitor>custom\_uptime\_ranges | rational number (with 3 decimals) | the uptime ratio of the monitor for the given ranges (if there is more than 1 range, then the values are seperated with "-") |
| monitor>average\_response\_time | rational number (with 3 decimals) | the average value of the response times (requires `response_times=1`) |
| monitor>custom\_http\_headers | JSON object | used for setting custom HTTP headers for the monitor |
| monitor>custom\_http\_statuses | text | For ex: 404:0\_200:1 (to accept 404 as down and 200 as up) |
| monitor>http\_method | - 1 - HEAD<br>- 2 - GET<br>- 3 - POST<br>- 4 - PUT<br>- 5 - PATCH<br>- 6 - DELETE<br>- 7 - OPTIONS | the HTTP method to be used |
| monitor>post\_type | - 1 - key-value<br>- 2 - raw data | the format of data to be sent with POST, PUT, PATCH, DELETE, OPTIONS HTTP methods |
| monitor>post\_value | JSON | the data to be sent with POST, PUT, PATCH, DELETE, OPTIONS HTTP methods |
| monitor>post\_content\_type | - 0 - text/html<br>- 1 - application/json | sets the `Content-Type` for POST, PUT, PATCH, DELETE, OPTIONS HTTP methods |
| log>type | - 1 - down<br>- 2 - up<br>- 99 - paused<br>- 98 - started | the value of the keyword. |
| log>datetime | Unix time | the date and time of the log (inherits the user's timezone setting). |
| log>duration | seconds (integer) | the duration of the downtime in seconds. |
| log>reason | text | the reason of the downtime (if exists). |
| response\_time>datetime | Unix time | the date and time of the log (inherits the user's timezone setting). |
| response\_time>value | Integer | the time to first-byte in milliseconds. |
| alertcontact>id | integer | the ID of the alert contact. |
| alertcontact>type | - 1 or sms (deprecated)<br>- 2 or e-mail<br>- 3 or twitter<br>- 5 or web-hook<br>- 6 or pushbullet<br>- 7 or zapier<br>- 8 or pro-sms (deprecated)<br>- 9 or pushover<br>- 11 or slack<br>- 14 or voice-call (deprecated)<br>- 15 or splunk<br>- 16 or pagerduty<br>- 17 or opsgenie<br>- 20 or ms-teams<br>- 21 or google-chat<br>- 23 or discord | the type of the alert contact notified. |
| alertcontact>friendly\_name | text | friendly name of the alert contact (for making it easier to distinguish from others). |
| alertcontact>value | - number:<br>  - sms (deprecated)<br>  - voice-call (deprecated)<br>  - pro-sms (deprecated)<br> _**format :** 12345678910 (with country code)_ <br>- email address:<br>  - e-mail<br>  - boxcar<br> _**format :** user@uptimerobot.com_ <br>- api key:<br>  - pushover<br>  - pushbullet<br>  - pagerduty<br> _**format :** dXB0aW1lcm9ib3Q=_ <br>- url:<br>  - web-hook<br>  - slack<br>  - zapier<br>  - splunk<br>  - opsgenie<br>  - ms-teams<br>  - google-chat<br>  - discord<br> _**format :** https://example.com/webhook/_ <br>- username:<br>  - twitter<br> _**format :** username_ | alert contact's email address, phone, username, url or api key depending on the alert contact type. |
| alertcontact>status | - 0 - not activated<br>- 1 - paused<br>- 2 - active | the status of the alert contact. |
| alertcontact>threshold | 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,30,35,40,45,50,55,60,70,80,90,100,110,120,150,180,210,240,270,300,360,420,480,540,600,660,720 | the x value that is set to define "if down for x minutes, alert every y minutes. |
| alertcontact>recurrence | 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,30,35,40,45,50,55,60 | the y value that is set to define "if down for x minutes, alert every y minutes. |
| mwindow>id | integer | the ID of the maintenance window. |
| mwindow>type | - 1 - Once<br>- 2 - Daily<br>- 3 - Weekly<br>- 4 - Monthly | the type of the maintenance window. |
| mwindow>friendly\_name | text | friendly name of the maintenance window (for making it easier to distinguish from others). |
| mwindow>value | text | seperated with "-" and used only for weekly and monthly maintenance windows. |
| mwindow>start\_time | Unix time for type=1 and HH:mm for other types. | start time of the maintenance windows. |
| mwindow>duration | Integer | duration of the maintenance windows in minutes. |
| mwindow>status | - 0 - paused<br>- 1 - active | the status of the maintenance window. |
| psp>id | integer | the ID of the status page. |
| psp>friendly\_name | text | friendly name of the status page (for making it easier to distinguish from others). |
| psp>monitors | text | the list of `monitorID`s to be displayed in status page (the values are seperated with "-" or 0 for all monitors). |
| psp>custom\_domain | text | the domain or subdomain that the status page will run on. |
| psp>password | text | the password for the status page. |
| psp>sort | - 1 - friendly name (a-z)<br>- 2 - friendly name (z-a)<br>- 3 - status (up-down-paused)<br>- 4 - status (down-up-paused) | the sorting of the status page. |
| psp>status | - 0 - paused<br>- 1 - active | the status of the status page. |
| psp>hide\_url\_links | boolean | removes the uptimerobot link from the status page (pro plan feature). |

- Features

Uptime monitoring

- [Website & endpoint monitoring](https://uptimerobot.com/website-monitoring/?ref=header)
  - [Keyword monitoring](https://uptimerobot.com/keyword-monitoring/?ref=header)
  - [Ping monitoring](https://uptimerobot.com/ping-monitoring/?ref=header)
  - [Port monitoring](https://uptimerobot.com/port-monitoring/?ref=header)
  - [Cron job monitoring](https://uptimerobot.com/cron-job-monitoring/?ref=header)

Monitoring features

- [Domain monitoring](https://uptimerobot.com/domain-expiration-monitoring/?ref=header)
  - [SSL monitoring](https://uptimerobot.com/ssl-monitoring/?ref=header)
  - [Response time monitoring](https://uptimerobot.com/response-time-monitoring/?ref=header)
  - [Multi-location monitoring](https://uptimerobot.com/location-specific-monitoring/?ref=header)
  - [DNS monitoring](https://uptimerobot.com/dns-monitoring/?ref=header)
  - [API monitoring](https://uptimerobot.com/api-monitoring/?ref=header)

-  Incident management](https://uptimerobot.com/incident-management/?ref=header)
  -  IT alerting software](https://uptimerobot.com/it-alerting-software/?ref=header)
  -  Status pages](https://uptimerobot.com/status-page/?ref=header)

- Solutions

For every team

- [Devops](https://uptimerobot.com/monitoring-for-devops/?ref=header)
  - [Developers](https://uptimerobot.com/monitoring-for-developers/?ref=header)
  - [Marketers](https://uptimerobot.com/monitoring-for-marketers/?ref=header)
  - [Support](https://uptimerobot.com/monitoring-for-support/?ref=header)
  - [Business owners](https://uptimerobot.com/monitoring-for-business-owners/?ref=header)

Go further with

- [API](https://uptimerobot.com/api/?ref=header)
  - [MCP](https://uptimerobot.com/mcp/?ref=header)
  - [Integrations](https://uptimerobot.com/integrations/?ref=header)
  - [Mobile app](https://uptimerobot.com/mobile-app/?ref=header)

Meet our users

- [Customers](https://uptimerobot.com/customers/?ref=header)

- [Enterprise](https://uptimerobot.com/enterprise/?ref=header)

- Resources

Help & learn

- [Help center](https://help.uptimerobot.com/en/)
  - [Location and IPs](https://uptimerobot.com/help/locations/?ref=header)
  - [API docs](https://uptimerobot.com/api/v3/?ref=header)
  - [Knowledge hub](https://uptimerobot.com/knowledge-hub/?ref=header)

Community

- [Roadmap](https://uptimerobot.com/roadmap/?ref=header)
  - [Blog](https://uptimerobot.com/blog/?ref=header)
  - [Discord](https://uptimerobot.com/blog/uptimerobot-discord/?ref=header)
  - [Referral program](https://uptimerobot.com/referral/?ref=header)
  - [Affiliate program](https://uptimerobot.com/affiliate/?ref=header)
  - [Non-profit](https://uptimerobot.com/sponsorship/?ref=header)
  - [Suggest a feature](https://uptimerobot.nolt.io/?ref=header)

Free tools

- [Subnet calculator](https://uptimerobot.com/free-tools/ip-subnet-calculator/?ref=header)
    Find the subnet of any IP address

- [DNS lookup](https://uptimerobot.com/free-tools/dns-lookup/?ref=header)
    Instantly check DNS records for any domain

- [Uptime calculator](https://uptimerobot.com/free-tools/uptime-downtime-calculator/?ref=header)
    Calculate uptime, downtime, and outage costs

- [CrontabRobot](https://uptimerobot.com/free-tools/cron-expression-generator/?ref=header)
    Create and validate crontab expressions

- [Website change detection](https://uptimerobot.com/free-tools/website-change-detection-tool/?ref=header)
    Track visual changes on any webpage

- [Pricing](https://uptimerobot.com/pricing/?ref=header)

[Log In](https://dashboard.uptimerobot.com/login?ref=header) [Register for FREE](https://dashboard.uptimerobot.com/sign-up?ref=header)
