API Documentation
The UptimeTea API is easy to use and free for all plans.
Create incident
Opens an incident by hand, for problems a watcher didn't catch.
POST
https://api.uptimetea.com/incidents
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
incident.watcher_idREQUIREDSTRINGWatcher the incident belongs to.
-
incident.descriptionREQUIREDSTRINGWhat is wrong.
-
incident.statusSTRINGopen, acknowledged or resolved. Defaults to open.
-
incident.started_atSTRINGWhen it started, ISO 8601. Defaults to now.
Response body
{
"id": "uuid",
"watcher_id": "uuid",
"watcher": {
"id": "uuid",
"title": "My Website",
"url": "https://example.com",
"category": "website"
},
"status": "open",
"description": "Checkout is failing for EU customers",
"started_at": "2024-01-15T10:00:00Z",
"acknowledged_at": null,
"resolved_at": null,
"duration": null,
"comments_count": 0,
"created_at": "2024-01-15T10:00:00Z"
}
Code examples
curl -X POST "https://api.uptimetea.com/incidents" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"incident": {
"watcher_id": "uuid",
"description": "Checkout is failing for EU customers"
}
}'
// Create incident
const response = await fetch('https://api.uptimetea.com/incidents', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"incident": {
"watcher_id": "uuid",
"description": "Checkout is failing for EU customers"
}
})
});
const data = await response.json();
console.log(data);
# Create incident
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.post(
'https://api.uptimetea.com/incidents',
headers=headers,
json={
'incident': {
'watcher_id': 'uuid',
'description': 'Checkout is failing for EU customers'
}
}
)
print(response.json())
// Create incident
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"incident": {
"watcher_id": "uuid",
"description": "Checkout is failing for EU customers"
}
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/incidents", 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))
}
# Create incident
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/incidents')
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
{
"incident": {
"watcher_id": "uuid",
"description": "Checkout is failing for EU customers"
}
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Create incident
$ch = curl_init('https://api.uptimetea.com/incidents');
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'
{
"incident": {
"watcher_id": "uuid",
"description": "Checkout is failing for EU customers"
}
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);