API Documentation
The UptimeTea API is easy to use and free for all plans.
Update incident status
Updates an incident status. Acknowledging or resolving sets acknowledged_at or resolved_at the first time.
PATCH
https://api.uptimetea.com/incidents/:id
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
incident.statusREQUIREDSTRINGopen, acknowledged or resolved.
Response body
{
"id": "uuid",
"watcher_id": "uuid",
"watcher": {
"id": "uuid",
"title": "My Website",
"url": "https://example.com",
"category": "website"
},
"status": "resolved",
"description": "Website monitor 'My Website' is down",
"started_at": "2024-01-15T10:00:00Z",
"acknowledged_at": "2024-01-15T10:05:00Z",
"resolved_at": "2024-01-15T11:00:00Z",
"duration": 3600,
"comments_count": 0,
"created_at": "2024-01-15T10:00:00Z"
}
Code examples
curl -X PATCH "https://api.uptimetea.com/incidents/$INCIDENT_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"incident": {
"status": "resolved"
}
}'
// Update incident status
const response = await fetch('https://api.uptimetea.com/incidents/INCIDENT_ID', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"incident": {
"status": "resolved"
}
})
});
const data = await response.json();
console.log(data);
# Update incident status
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.patch(
'https://api.uptimetea.com/incidents/INCIDENT_ID',
headers=headers,
json={
'incident': {
'status': 'resolved'
}
}
)
print(response.json())
// Update incident status
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"incident": {
"status": "resolved"
}
}`)
req, _ := http.NewRequest("PATCH", "https://api.uptimetea.com/incidents/INCIDENT_ID", 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))
}
# Update incident status
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/incidents/INCIDENT_ID')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Authorization'] = "Bearer #{your_token}"
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"incident": {
"status": "resolved"
}
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Update incident status
$ch = curl_init('https://api.uptimetea.com/incidents/INCIDENT_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $yourToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"incident": {
"status": "resolved"
}
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);