API Documentation
The UptimeTea API is easy to use and free for all plans.
Get postmortem
Returns the incident's postmortem. A resolved incident without one returns an unsaved draft with a null id. An unresolved incident without one returns 400.
GET
https://api.uptimetea.com/incidents/:incident_id/postmortem
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN
Response body
{
"id": "uuid",
"incident_id": "uuid",
"summary": "The checkout API returned 502s for 18 minutes.",
"timeline": "10:00 alert fired\n10:05 acknowledged\n10:18 rolled back",
"impact": "About 4% of checkouts failed.",
"root_cause": "A config change dropped the upstream pool to one node.",
"action_items": [
{
"id": "uuid",
"title": "Alert on upstream pool size",
"assignee_id": "uuid",
"completed_at": null,
"created_at": "2024-01-15T12:00:00Z"
}
],
"updated_at": "2024-01-15T12:00:00Z"
}
Code examples
curl -X GET "https://api.uptimetea.com/incidents/$INCIDENT_ID/postmortem" \
-H "Authorization: Bearer $TOKEN"
// Get postmortem
const response = await fetch('https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem', {
headers: {
'Authorization': 'Bearer ' + yourToken
}
});
const data = await response.json();
console.log(data);
# Get postmortem
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.get(
'https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem',
headers=headers
)
print(response.json())
// Get postmortem
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem", 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))
}
# Get postmortem
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem')
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
// Get postmortem
$ch = curl_init('https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem');
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);