Get an alert
curl --request GET \
--url https://api.coval.dev/v1/alerts/{alert_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.coval.dev/v1/alerts/{alert_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.coval.dev/v1/alerts/{alert_id}', 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.coval.dev/v1/alerts/{alert_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coval.dev/v1/alerts/{alert_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coval.dev/v1/alerts/{alert_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/alerts/{alert_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ulid": "01HZ0EXAMPLE00000000000000",
"name": "Latency SLA Alert",
"status": "ACTIVE",
"evaluation_type": "ON_RUN_COMPLETE",
"conversation_source": "ALL",
"match_mode": "ALL",
"cooldown_seconds": 43200,
"trigger_count": 123,
"conditions": [
{
"ulid": "<string>",
"metric_id": "<string>",
"aggregation": "SINGLE",
"operator": "GT",
"threshold_float": 123,
"threshold_string": "<string>",
"window_size_days": 183,
"window_size_runs": 5000,
"match_value": "<string>",
"match_mode": "exact"
}
],
"channels": [
{
"ulid": "<string>",
"channel_type": "SLACK",
"config": {}
}
],
"create_time": "2023-11-07T05:31:56Z",
"update_time": "2023-11-07T05:31:56Z",
"description": "",
"custom_message_template": "<string>",
"agent_ids": [
"<string>"
],
"required_tags": [
"<string>"
],
"scheduled_run_ids": [
"<string>"
],
"last_triggered_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication failed",
"details": [
{
"field": "X-API-Key",
"description": "Invalid or missing API key"
}
]
}
}{
"error": {
"code": "PERMISSION_DENIED",
"message": "Insufficient permissions",
"details": [
{
"field": "permissions",
"description": "Required scope: alerts:read"
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Alert not found",
"details": [
{
"field": "alert_id",
"description": "Alert '01HZ0EXAMPLE00000000000000' not found"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred"
}
]
}
}Alerts
Get an alert
Returns a single alert with its conditions and channels.
GET
/
alerts
/
{alert_id}
Get an alert
curl --request GET \
--url https://api.coval.dev/v1/alerts/{alert_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.coval.dev/v1/alerts/{alert_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.coval.dev/v1/alerts/{alert_id}', 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.coval.dev/v1/alerts/{alert_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coval.dev/v1/alerts/{alert_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coval.dev/v1/alerts/{alert_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/alerts/{alert_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ulid": "01HZ0EXAMPLE00000000000000",
"name": "Latency SLA Alert",
"status": "ACTIVE",
"evaluation_type": "ON_RUN_COMPLETE",
"conversation_source": "ALL",
"match_mode": "ALL",
"cooldown_seconds": 43200,
"trigger_count": 123,
"conditions": [
{
"ulid": "<string>",
"metric_id": "<string>",
"aggregation": "SINGLE",
"operator": "GT",
"threshold_float": 123,
"threshold_string": "<string>",
"window_size_days": 183,
"window_size_runs": 5000,
"match_value": "<string>",
"match_mode": "exact"
}
],
"channels": [
{
"ulid": "<string>",
"channel_type": "SLACK",
"config": {}
}
],
"create_time": "2023-11-07T05:31:56Z",
"update_time": "2023-11-07T05:31:56Z",
"description": "",
"custom_message_template": "<string>",
"agent_ids": [
"<string>"
],
"required_tags": [
"<string>"
],
"scheduled_run_ids": [
"<string>"
],
"last_triggered_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication failed",
"details": [
{
"field": "X-API-Key",
"description": "Invalid or missing API key"
}
]
}
}{
"error": {
"code": "PERMISSION_DENIED",
"message": "Insufficient permissions",
"details": [
{
"field": "permissions",
"description": "Required scope: alerts:read"
}
]
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Alert not found",
"details": [
{
"field": "alert_id",
"description": "Alert '01HZ0EXAMPLE00000000000000' not found"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred"
}
]
}
}Authorizations
API key for authentication
Path Parameters
Alert ULID
Pattern:
^[0-9A-Z]{26}$Response
Alert details
Alert ULID
Pattern:
^[0-9A-Z]{26}$Example:
"01HZ0EXAMPLE00000000000000"
Human-readable alert name
Maximum string length:
200Example:
"Latency SLA Alert"
Alert status
Available options:
ACTIVE, DELETED When the alert evaluates
Available options:
ON_RUN_COMPLETE Which conversations the alert applies to
Available options:
ALL, UPLOADED, SIMULATED How multiple conditions are combined (AND vs OR)
Available options:
ALL, ANY Minimum seconds between triggers
Required range:
0 <= x <= 86400Number of times this alert has triggered
Evaluation conditions
Show child attributes
Show child attributes
Notification channels
Show child attributes
Show child attributes
Creation timestamp
Last update timestamp
Optional description
Custom notification message template
Maximum string length:
5000Restrict to specific agent IDs
Restrict to runs with these tags
Restrict to runs originating from these scheduled runs
Last trigger timestamp
Was this page helpful?