UptimeTea

API Documentation

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

Send test event

Sends a test event for a sample watcher right away, without retries, and returns the delivery attempt.

POST https://api.uptimetea.com/webhooks/:id/test

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN

Response body

{
  "id": "uuid",
  "event": "test",
  "attempt": 1,
  "success": true,
  "response_status": 200,
  "response_body": "ok",
  "error": null,
  "delivered_at": "2024-01-15T10:00:01Z",
  "created_at": "2024-01-15T10:00:00Z"
}

Code examples

curl -X POST "https://api.uptimetea.com/webhooks/$WEBHOOK_ID/test" \
  -H "Authorization: Bearer $TOKEN"
// Send test event
const response = await fetch('https://api.uptimetea.com/webhooks/WEBHOOK_ID/test', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + yourToken
  }
});

const data = await response.json();
console.log(data);
# Send test event
import requests

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

response = requests.post(
    'https://api.uptimetea.com/webhooks/WEBHOOK_ID/test',
    headers=headers
)

print(response.json())
// Send test event
package main

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

func main() {
    req, _ := http.NewRequest("POST", "https://api.uptimetea.com/webhooks/WEBHOOK_ID/test", 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))
}
# Send test event
require 'net/http'
require 'uri'

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

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

response = http.request(request)
puts response.code, response.body
<?php
// Send test event
$ch = curl_init('https://api.uptimetea.com/webhooks/WEBHOOK_ID/test');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $yourToken
]);

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