UptimeTea

API Documentation

The UptimeTea API is easy to use and free for all plans.

List watchers

Returns all your team's watchers (monitors), failing ones first, then by title. Fields that only apply to some categories appear only on watchers of those categories.

GET https://api.uptimetea.com/watchers

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN

Response body

[
  {
    "id": "uuid",
    "title": "My Website",
    "category": "website",
    "url": "https://example.com",
    "status": "success",
    "tags": ["production"],
    "last_checked_at": "2024-01-15T10:30:00Z",
    "uptime_percentage": 99.5,
    "consecutive_failures": 0,
    "check_interval": 300,
    "notify_email": true,
    "notify_sms": false,
    "notify_call": false,
    "on_call_schedule_id": null,
    "escalation_policy_id": null,
    "in_maintenance": false,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "expected_content": "Welcome",
    "content_case_sensitive": false,
    "content_regex": false,
    "sla_target": 99.9,
    "sla_breached": false
  }
]

Response fields

  • statusSTRING

    pending until the first check, then success, warning or error.

  • uptime_percentageNUMBER

    Share of successful checks over the last 24 hours; null before the first check.

  • in_maintenanceBOOLEAN

    true while a maintenance window covers the watcher.

  • sla_target, sla_breached

    Not on cron_job, heartbeat or rum watchers. The 30-day uptime target and whether uptime is below it.

  • expected_content, content_case_sensitive, content_regex

    Only on website and server watchers. The response body check.

  • ssl_warning_threshold, ssl_cert_expiry_date, ssl_cert_issuer, ssl_cert_common_name, ssl_days_until_expiry

    Only on ssl_certificate watchers. The certificate found on the last check.

  • domain_warning_threshold, domain_expiry_date, domain_registrar, domain_days_until_expiry

    Only on domain_expiration watchers. The registration found on the last check.

  • callback_url, callback_token, expected_interval, last_callback_at, recent_callbacks

    Only on cron_job and heartbeat watchers. POST to callback_url from your job; recent_callbacks lists the last 20 calls.

  • expected_redirect_code, expected_redirect_url

    Only on redirect watchers. The redirect the check expects.

  • callback_token, rum_script_url

    Only on rum watchers. Load rum_script_url on your pages with the token to report visits.

  • blacklist_results

    Only on blacklist watchers. Results of the last blacklist lookup.

  • port, protocol

    Only on port watchers. The port and protocol checked.

Code examples

curl -X GET "https://api.uptimetea.com/watchers" \
  -H "Authorization: Bearer $TOKEN"
// List watchers
const response = await fetch('https://api.uptimetea.com/watchers', {
  headers: {
    'Authorization': 'Bearer ' + yourToken
  }
});

const data = await response.json();
console.log(data);
# List watchers
import requests

headers = {'Authorization': f'Bearer {your_token}'}

response = requests.get(
    'https://api.uptimetea.com/watchers',
    headers=headers
)

print(response.json())
// List watchers
package main

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

func main() {
    req, _ := http.NewRequest("GET", "https://api.uptimetea.com/watchers", nil)
    req.Header.Set("Authorization", "Bearer "+yourToken)

    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))
}
# List watchers
require 'net/http'
require 'uri'

uri = URI('https://api.uptimetea.com/watchers')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{your_token}"

response = http.request(request)
puts response.code, response.body
<?php
// List watchers
$ch = curl_init('https://api.uptimetea.com/watchers');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $yourToken
]);

$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);