Create Alert (OpsGenie)
curl --request POST \
--url https://api.warrn.io/v2/alerts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"alias": "<string>",
"description": "<string>",
"priority": "P3",
"responders": [
{
"name": "<string>"
}
],
"tags": [
"<string>"
],
"details": {},
"entity": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.warrn.io/v2/alerts/"
payload = {
"message": "<string>",
"alias": "<string>",
"description": "<string>",
"priority": "P3",
"responders": [{ "name": "<string>" }],
"tags": ["<string>"],
"details": {},
"entity": "<string>",
"source": "<string>"
}
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({
message: '<string>',
alias: '<string>',
description: '<string>',
priority: 'P3',
responders: [{name: '<string>'}],
tags: ['<string>'],
details: {},
entity: '<string>',
source: '<string>'
})
};
fetch('https://api.warrn.io/v2/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/v2/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([
'message' => '<string>',
'alias' => '<string>',
'description' => '<string>',
'priority' => 'P3',
'responders' => [
[
'name' => '<string>'
]
],
'tags' => [
'<string>'
],
'details' => [
],
'entity' => '<string>',
'source' => '<string>'
]),
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/v2/alerts/"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\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/v2/alerts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.warrn.io/v2/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 \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": "Request will be processed",
"took": 0,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Unauthorized"
}OpsGenie Compatible
Create Alert (OpsGenie)
Create an alert using the OpsGenie request format. Warrn transforms the payload to its native format.
POST
/
v2
/
alerts
/
Create Alert (OpsGenie)
curl --request POST \
--url https://api.warrn.io/v2/alerts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"alias": "<string>",
"description": "<string>",
"priority": "P3",
"responders": [
{
"name": "<string>"
}
],
"tags": [
"<string>"
],
"details": {},
"entity": "<string>",
"source": "<string>"
}
'import requests
url = "https://api.warrn.io/v2/alerts/"
payload = {
"message": "<string>",
"alias": "<string>",
"description": "<string>",
"priority": "P3",
"responders": [{ "name": "<string>" }],
"tags": ["<string>"],
"details": {},
"entity": "<string>",
"source": "<string>"
}
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({
message: '<string>',
alias: '<string>',
description: '<string>',
priority: 'P3',
responders: [{name: '<string>'}],
tags: ['<string>'],
details: {},
entity: '<string>',
source: '<string>'
})
};
fetch('https://api.warrn.io/v2/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/v2/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([
'message' => '<string>',
'alias' => '<string>',
'description' => '<string>',
'priority' => 'P3',
'responders' => [
[
'name' => '<string>'
]
],
'tags' => [
'<string>'
],
'details' => [
],
'entity' => '<string>',
'source' => '<string>'
]),
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/v2/alerts/"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\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/v2/alerts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.warrn.io/v2/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 \"message\": \"<string>\",\n \"alias\": \"<string>\",\n \"description\": \"<string>\",\n \"priority\": \"P3\",\n \"responders\": [\n {\n \"name\": \"<string>\"\n }\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"details\": {},\n \"entity\": \"<string>\",\n \"source\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"result": "Request will be processed",
"took": 0,
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "Unauthorized"
}Authorizations
Bearer token using your Warrn API key.
Body
application/json
Alert message. Maps to alert name in Warrn.
Maximum string length:
255Stable alias for deduplication and later lookup.
P1→critical, P2→high, P3→medium, P4/P5→low.
Available options:
P1, P2, P3, P4, P5 Show child attributes
Show child attributes
Resolved to a service by name match.
⌘I