API Documentation
The UptimeTea API is easy to use and free for all plans.
Create incident comment
Adds a comment to an incident. Team members listed in mentioned_user_ids get an email with the comment.
POST
https://api.uptimetea.com/incidents/:incident_id/comments
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
incident_comment.contentREQUIREDSTRINGComment text.
-
incident_comment.mentioned_user_idsARRAYIDs of team members to notify by email. You are never notified of your own comment.
Response body
{
"id": "uuid",
"incident_id": "uuid",
"user_id": "uuid",
"content": "Rolled back the last deploy, watching error rates.",
"created_at": "2024-01-15T10:20:00Z"
}
Code examples
curl -X POST "https://api.uptimetea.com/incidents/$INCIDENT_ID/comments" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"incident_comment": {
"content": "Rolled back the last deploy, watching error rates.",
"mentioned_user_ids": ["uuid"]
}
}'
// Create incident comment
const response = await fetch('https://api.uptimetea.com/incidents/INCIDENT_ID/comments', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"incident_comment": {
"content": "Rolled back the last deploy, watching error rates.",
"mentioned_user_ids": ["uuid"]
}
})
});
const data = await response.json();
console.log(data);
# Create incident comment
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.post(
'https://api.uptimetea.com/incidents/INCIDENT_ID/comments',
headers=headers,
json={
'incident_comment': {
'content': 'Rolled back the last deploy, watching error rates.',
'mentioned_user_ids': ['uuid']
}
}
)
print(response.json())
// Create incident comment
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"incident_comment": {
"content": "Rolled back the last deploy, watching error rates.",
"mentioned_user_ids": ["uuid"]
}
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/incidents/INCIDENT_ID/comments", 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 comment
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/incidents/INCIDENT_ID/comments')
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_comment": {
"content": "Rolled back the last deploy, watching error rates.",
"mentioned_user_ids": ["uuid"]
}
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Create incident comment
$ch = curl_init('https://api.uptimetea.com/incidents/INCIDENT_ID/comments');
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_comment": {
"content": "Rolled back the last deploy, watching error rates.",
"mentioned_user_ids": ["uuid"]
}
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);