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 updatesAuthentication
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_keys 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
orhttps://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
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{ "stat": "ok", "account": { "email": "test@domain.com", "monitor_limit": 50, "monitor_interval": 1, "up_monitors": 1, "down_monitors": 0, "paused_monitors": 2 } }
<?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
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 like1465440758_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 is0
)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 withlogs_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 withlogs_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 is0
)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
andresponse_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 withresponse_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 withresponse_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 is0
)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 is0
)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 isfalse
)auth_type optional (defines if the auth type of each monitor will be returned. Should be set to true
for getting them. Default isfalse
)timezone optional (defines if the user's timezone should be returned. Should be set to 1
for getting it. Default is0
)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
andfriendly_name
and get filtered results)Example
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{ "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 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
New monitors of any type can be created using this method.
Parameters
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) (must be sent as a JSON object)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 likealert_contacts=457_0_0-373_5_0-8956_2_3
wherealert_contact>ids
are seperated with - andthreshold
+recurrence
are seperated with _. For ex:alert_contacts=457_5_0
refers to 457 being thealert_contact>id
, 5 being thethreshold
and 0 being therecurrence
. 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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{ "stat": "ok", "monitor": { "id": 777810874, "status": 1 } }
<?xml version="1.0" encoding="UTF-8"?><monitor status="1" id="777810882"/>
- POST editMonitor
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
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) (must be sent as a JSON object)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 likealert_contacts=457_0_0-373_5_0-8956_2_3
wherealert_contact>id
s are seperated with - andthreshold
+recurrence
are seperated with _. For ex:alert_contacts=457_5_0
refers to 457 being thealert_contact>id
, 5 being thethreshold
and 0 being therecurrence
. 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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{"stat":"ok","monitor":{"id":777712827}}
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
- POST deleteMonitor
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{"stat":"ok","monitor":{"id":777712827}}
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
- POST resetMonitor
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
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"
$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; }
$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' )); $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; }
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"))
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)
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();
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); });
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)) }
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);
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 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
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
{ "stat":"ok", "monitor": { "id": 777712827 } }
<?xml version="1.0" encoding="UTF-8"?><monitor id="777712827"/>
- POST getAlertContacts
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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 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
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
{ "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 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
New alert contacts of any type (mobile/SMS alert contacts are not supported yet) 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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "alertcontact": { "id": "4561", "status": "0" } })
<alertcontact id="236" status="2"/></alertcontact>
- POST editAlertContact
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "alertcontact": { "id": "236" } })
<alertcontact id="236"/></alertcontact>
- POST deleteAlertContact
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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); });
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "alert_contact": { "id": "236" } })
<alertcontact id="236"/></alertcontact>
- POST getMWindows
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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 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
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
{ "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 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
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{ "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 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 editMWindow
Maintenance windows can be edited 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/editMWindow
Example
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
{ "stat": "ok", "mwindow": { "id": 256, "status": 1 } }
<?xml version="1.0" encoding="UTF-8"?><mwindow status="1" id="256"/>
- POST deleteMWindow
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
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"
$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; }
$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' )); $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; }
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"))
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)
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();
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); });
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)) }
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);
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 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
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
jsonUptimeRobotApi({ "stat": "ok", "mwindow": { "id": "2414745" } })
<?xml version="1.0" encoding="UTF-8"?><mwindow id="2414745"/>
- POST getPSPs
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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 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
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
{ "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 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
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
. Or0
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "psp": { "id": "4561" } })
<psp id="236" status="2"/></psp>
- POST editPSP
Public status pages can be edited 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
. Or0
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/editPSP
Example
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"
$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; }
$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; }
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"))
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)
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();
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); });
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)) }
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "psp": { "id": "4561" } })
<psp id="236" status="2"/></psp>
- POST deletePSP
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
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"
$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; }
$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; }
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"))
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)
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();
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); });
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); });
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);
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
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
jsonUptimeRobotApi({ "stat": "ok", "psp": { "id": "236" } })
<?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 |
| 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 |
| the type of the monitor. |
monitor>sub_type |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| the HTTP method to be used |
monitor>post_type |
| 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 |
| sets the Content-Type for POST, PUT, PATCH, DELETE, OPTIONS HTTP methods |
log>type |
| 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 |
| 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 |
| alert contact's email address, phone, username, url or api key depending on the alert contact type. |
alertcontact>status |
| 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 |
| 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 |
| 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 |
| the sorting of the status page. |
psp>status |
| the status of the status page. |
psp>hide_url_links | boolean | removes the uptimerobot link from the status page (pro plan feature). |