API Documentation
The UptimeTea API is easy to use and free for all plans.
Protect a whole site
Creates website, ssl_certificate and domain_expiration watchers for one URL, plus a status page listing all three, in a single call. Each watcher has the same shape as in Create watcher.
POST
https://api.uptimetea.com/watchers/bundle
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
titleREQUIREDSTRINGName for the watchers and the status page.
-
urlREQUIREDSTRINGSite URL, starting with http:// or https://. Its host becomes the status page slug.
-
tagsARRAYLabels for filtering, such as ["production"].
-
notify_emailBOOLEANEmail alerts. Defaults to your alert preferences.
-
notify_smsBOOLEANSMS alerts. Defaults to your alert preferences.
-
notify_callBOOLEANPhone call alerts. Defaults to your alert preferences.
-
on_call_schedule_idSTRINGAlert whoever is on call for this schedule.
-
escalation_policy_idSTRINGEscalate unacknowledged incidents with this policy.
Response body
{
"watchers": [
{
"id": "uuid",
"title": "Example",
"category": "website",
"url": "https://example.com",
"status": "pending"
},
{
"id": "uuid",
"title": "Example",
"category": "ssl_certificate",
"url": "https://example.com",
"status": "pending"
},
{
"id": "uuid",
"title": "Example",
"category": "domain_expiration",
"url": "https://example.com",
"status": "pending"
}
],
"status_page": {
"id": "uuid",
"name": "Example",
"slug": "example-com",
"custom_domain": null,
"logo_url": null,
"brand_color": null,
"page_title": null,
"hide_branding": false,
"created_at": "2024-01-15T10:00:00Z",
"watchers": [
{
"id": "uuid",
"title": "My Website",
"url": "https://example.com",
"status": "success"
}
]
}
}
Code examples
curl -X POST "https://api.uptimetea.com/watchers/bundle" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Example",
"url": "https://example.com",
"tags": ["production"]
}'
// Protect a whole site
const response = await fetch('https://api.uptimetea.com/watchers/bundle', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"title": "Example",
"url": "https://example.com",
"tags": ["production"]
})
});
const data = await response.json();
console.log(data);
# Protect a whole site
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.post(
'https://api.uptimetea.com/watchers/bundle',
headers=headers,
json={
'title': 'Example',
'url': 'https://example.com',
'tags': ['production']
}
)
print(response.json())
// Protect a whole site
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"title": "Example",
"url": "https://example.com",
"tags": ["production"]
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/watchers/bundle", body)
req.Header.Set("Authorization", "Bearer "+yourToken)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(data))
}
# Protect a whole site
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/watchers/bundle')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{your_token}"
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"title": "Example",
"url": "https://example.com",
"tags": ["production"]
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Protect a whole site
$ch = curl_init('https://api.uptimetea.com/watchers/bundle');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $yourToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"title": "Example",
"url": "https://example.com",
"tags": ["production"]
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);