Create Alert
curl --request POST \
--url https://api.warrn.io/alerts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High error rate on checkout-service",
"description": "Error rate exceeded 5% threshold for the past 3 minutes.",
"severity": "high",
"team_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"service_id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"tags": [
"checkout",
"production",
"error-rate"
],
"metadata": {
"error_rate": "7.2%",
"threshold": "5%"
}
}
'import requests
url = "https://api.warrn.io/alerts/"
payload = {
"name": "High error rate on checkout-service",
"description": "Error rate exceeded 5% threshold for the past 3 minutes.",
"severity": "high",
"team_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"service_id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"tags": ["checkout", "production", "error-rate"],
"metadata": {
"error_rate": "7.2%",
"threshold": "5%"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High error rate on checkout-service',
description: 'Error rate exceeded 5% threshold for the past 3 minutes.',
severity: 'high',
team_id: 'f1e2d3c4-b5a6-7890-1234-567890abcdef',
service_id: 'd4e5f6a7-b8c9-0123-4567-89abcdef0123',
tags: ['checkout', 'production', 'error-rate'],
metadata: {error_rate: '7.2%', threshold: '5%'}
})
};
fetch('https://api.warrn.io/alerts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.warrn.io/alerts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'High error rate on checkout-service',
'description' => 'Error rate exceeded 5% threshold for the past 3 minutes.',
'severity' => 'high',
'team_id' => 'f1e2d3c4-b5a6-7890-1234-567890abcdef',
'service_id' => 'd4e5f6a7-b8c9-0123-4567-89abcdef0123',
'tags' => [
'checkout',
'production',
'error-rate'
],
'metadata' => [
'error_rate' => '7.2%',
'threshold' => '5%'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.warrn.io/alerts/"
payload := strings.NewReader("{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.warrn.io/alerts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.warrn.io/alerts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"source": "integration",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_name": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"acknowledged_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"alert_alias": "<string>",
"occurrence_count": 123
}{
"detail": "Unauthorized"
}Alerts
Create Alert
Create a new alert and route it through Warrn’s triage pipeline.
POST
/
alerts
/
Create Alert
curl --request POST \
--url https://api.warrn.io/alerts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High error rate on checkout-service",
"description": "Error rate exceeded 5% threshold for the past 3 minutes.",
"severity": "high",
"team_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"service_id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"tags": [
"checkout",
"production",
"error-rate"
],
"metadata": {
"error_rate": "7.2%",
"threshold": "5%"
}
}
'import requests
url = "https://api.warrn.io/alerts/"
payload = {
"name": "High error rate on checkout-service",
"description": "Error rate exceeded 5% threshold for the past 3 minutes.",
"severity": "high",
"team_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"service_id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"tags": ["checkout", "production", "error-rate"],
"metadata": {
"error_rate": "7.2%",
"threshold": "5%"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High error rate on checkout-service',
description: 'Error rate exceeded 5% threshold for the past 3 minutes.',
severity: 'high',
team_id: 'f1e2d3c4-b5a6-7890-1234-567890abcdef',
service_id: 'd4e5f6a7-b8c9-0123-4567-89abcdef0123',
tags: ['checkout', 'production', 'error-rate'],
metadata: {error_rate: '7.2%', threshold: '5%'}
})
};
fetch('https://api.warrn.io/alerts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.warrn.io/alerts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'High error rate on checkout-service',
'description' => 'Error rate exceeded 5% threshold for the past 3 minutes.',
'severity' => 'high',
'team_id' => 'f1e2d3c4-b5a6-7890-1234-567890abcdef',
'service_id' => 'd4e5f6a7-b8c9-0123-4567-89abcdef0123',
'tags' => [
'checkout',
'production',
'error-rate'
],
'metadata' => [
'error_rate' => '7.2%',
'threshold' => '5%'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.warrn.io/alerts/"
payload := strings.NewReader("{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.warrn.io/alerts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.warrn.io/alerts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High error rate on checkout-service\",\n \"description\": \"Error rate exceeded 5% threshold for the past 3 minutes.\",\n \"severity\": \"high\",\n \"team_id\": \"f1e2d3c4-b5a6-7890-1234-567890abcdef\",\n \"service_id\": \"d4e5f6a7-b8c9-0123-4567-89abcdef0123\",\n \"tags\": [\n \"checkout\",\n \"production\",\n \"error-rate\"\n ],\n \"metadata\": {\n \"error_rate\": \"7.2%\",\n \"threshold\": \"5%\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"source": "integration",
"service_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"service_name": "<string>",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_name": "<string>",
"tags": [
"<string>"
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"acknowledged_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"alert_alias": "<string>",
"occurrence_count": 123
}{
"detail": "Unauthorized"
}Authorizations
Bearer token using your Warrn API key.
Body
application/json
Short summary of the alert.
Maximum string length:
255Detailed description of the issue.
Available options:
low, medium, high, critical Team this alert is routed to. Required.
Service this alert belongs to. Optional.
Arbitrary key-value pairs (runbook URLs, affected hosts, metric values).
Dedup key. While an alert with this alias is open or acknowledged, repeat creates with the same alias increment its occurrence_count instead of creating a new alert. Once resolved, the next create with the same alias makes a new alert. Also accepted as the path identifier on /alerts/{identifier}/resolve/?identifierType=alias.
Response
Alert created
Available options:
low, medium, high, critical Available options:
open, acknowledged, resolved Example:
"integration"
⌘I