UptimeTea

API Documentation

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

Update postmortem

Creates or updates the incident's postmortem. Every field is optional free text.

PATCH https://api.uptimetea.com/incidents/:incident_id/postmortem

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN
  • Content-TypeREQUIREDSTRING
    application/json

Body parameters

  • postmortem.summarySTRING

    What happened, in a sentence or two.

  • postmortem.timelineSTRING

    Key events in order.

  • postmortem.impactSTRING

    Who was affected and how.

  • postmortem.root_causeSTRING

    Why it happened.

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 PATCH "https://api.uptimetea.com/incidents/$INCIDENT_ID/postmortem" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "postmortem": {
      "summary": "The checkout API returned 502s for 18 minutes.",
      "impact": "About 4% of checkouts failed.",
      "root_cause": "A config change dropped the upstream pool to one node."
    }
  }'
// Update postmortem
const response = await fetch('https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer ' + yourToken,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "postmortem": {
      "summary": "The checkout API returned 502s for 18 minutes.",
      "impact": "About 4% of checkouts failed.",
      "root_cause": "A config change dropped the upstream pool to one node."
    }
  })
});

const data = await response.json();
console.log(data);
# Update postmortem
import requests

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

response = requests.patch(
    'https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem',
    headers=headers,
    json={
        'postmortem': {
            'summary': 'The checkout API returned 502s for 18 minutes.',
            'impact': 'About 4% of checkouts failed.',
            'root_cause': 'A config change dropped the upstream pool to one node.'
        }
    }
)

print(response.json())
// Update postmortem
package main

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

func main() {
    body := strings.NewReader(`{
      "postmortem": {
        "summary": "The checkout API returned 502s for 18 minutes.",
        "impact": "About 4% of checkouts failed.",
        "root_cause": "A config change dropped the upstream pool to one node."
      }
    }`)
    req, _ := http.NewRequest("PATCH", "https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem", 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 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::Patch.new(uri)
request['Authorization'] = "Bearer #{your_token}"
request['Content-Type'] = 'application/json'
request.body = <<~JSON
  {
    "postmortem": {
      "summary": "The checkout API returned 502s for 18 minutes.",
      "impact": "About 4% of checkouts failed.",
      "root_cause": "A config change dropped the upstream pool to one node."
    }
  }
JSON

response = http.request(request)
puts response.code, response.body
<?php
// Update postmortem
$ch = curl_init('https://api.uptimetea.com/incidents/INCIDENT_ID/postmortem');
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'
{
  "postmortem": {
    "summary": "The checkout API returned 502s for 18 minutes.",
    "impact": "About 4% of checkouts failed.",
    "root_cause": "A config change dropped the upstream pool to one node."
  }
}
JSON);

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