API Documentation
The UptimeTea API is easy to use and free for all plans.
Report cron/heartbeat status
Public endpoint for cron jobs and heartbeat monitors to report their execution status. No authentication required - uses callback token from watcher.
POST
https://api.uptimetea.com/callbacks/:callback_token
Headers
-
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
statusREQUIREDSTRINGsuccess or failure.
-
metadataOBJECTAny JSON you want stored with the call, such as duration or record counts.
Response body
{
"success": true
}
Code examples
curl -X POST "https://api.uptimetea.com/callbacks/$CALLBACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "success",
"metadata": {
"duration": 5.2,
"records_processed": 1000
}
}'
// Report cron/heartbeat status
const response = await fetch('https://api.uptimetea.com/callbacks/CALLBACK_TOKEN', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"status": "success",
"metadata": {
"duration": 5.2,
"records_processed": 1000
}
})
});
const data = await response.json();
console.log(data);
# Report cron/heartbeat status
import requests
response = requests.post(
'https://api.uptimetea.com/callbacks/CALLBACK_TOKEN',
json={
'status': 'success',
'metadata': {
'duration': 5.2,
'records_processed': 1000
}
}
)
print(response.json())
// Report cron/heartbeat status
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"status": "success",
"metadata": {
"duration": 5.2,
"records_processed": 1000
}
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/callbacks/CALLBACK_TOKEN", body)
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))
}
# Report cron/heartbeat status
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/callbacks/CALLBACK_TOKEN')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"status": "success",
"metadata": {
"duration": 5.2,
"records_processed": 1000
}
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Report cron/heartbeat status
$ch = curl_init('https://api.uptimetea.com/callbacks/CALLBACK_TOKEN');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"status": "success",
"metadata": {
"duration": 5.2,
"records_processed": 1000
}
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);