curl --request GET \
--url https://api.galtea.ai/monitors/{monitorId}/alert-rules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/monitors/{monitorId}/alert-rules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/monitors/{monitorId}/alert-rules', 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.galtea.ai/monitors/{monitorId}/alert-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.galtea.ai/monitors/{monitorId}/alert-rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/monitors/{monitorId}/alert-rules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/monitors/{monitorId}/alert-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "monitorAlertRule_123",
"monitorId": "monitor_123",
"type": "BAD_SESSION_COUNT",
"metricGroupId": "metricGroup_123",
"specificationId": null,
"window": "ONE_HOUR",
"badSessionScore": 0.5,
"threshold": 3,
"recipients": [
"team@example.com"
],
"webhookUrlHost": "hooks.slack.com",
"userId": "user_123",
"createdAt": "2023-11-07T05:31:56Z",
"pausedAt": null,
"readiness": {
"settledSessions": 3,
"requiredSessions": 5,
"isEvaluating": false
}
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}List a monitor's alert rules
Returns every live alert rule on this monitor, oldest first. Not paginated.
curl --request GET \
--url https://api.galtea.ai/monitors/{monitorId}/alert-rules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/monitors/{monitorId}/alert-rules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/monitors/{monitorId}/alert-rules', 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.galtea.ai/monitors/{monitorId}/alert-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.galtea.ai/monitors/{monitorId}/alert-rules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/monitors/{monitorId}/alert-rules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/monitors/{monitorId}/alert-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "monitorAlertRule_123",
"monitorId": "monitor_123",
"type": "BAD_SESSION_COUNT",
"metricGroupId": "metricGroup_123",
"specificationId": null,
"window": "ONE_HOUR",
"badSessionScore": 0.5,
"threshold": 3,
"recipients": [
"team@example.com"
],
"webhookUrlHost": "hooks.slack.com",
"userId": "user_123",
"createdAt": "2023-11-07T05:31:56Z",
"pausedAt": null,
"readiness": {
"settledSessions": 3,
"requiredSessions": 5,
"isEvaluating": false
}
}
]{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Path Parameters
Monitor ID
"monitor_123"
Response
Alert rules retrieved successfully
"monitorAlertRule_123"
"monitor_123"
BAD_SESSION_COUNT, NO_SCORE_RATE, AVERAGE_SCORE "BAD_SESSION_COUNT"
The metric family the rule watches; null for a rule that watches a Specification
"metricGroup_123"
The Specification the rule watches; null for a rule that watches a metric family
null
FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS, TWENTY_FOUR_HOURS "ONE_HOUR"
0.5
3
["team@example.com"]
The host and port of the webhook URL, such as hooks.slack.com or hooks.example.com:8443 (the port shows only when it is not the default); null when the rule has none. The URL is never returned.
"hooks.slack.com"
"user_123"
When the rule was paused; null while it is active
null
How close the rule is to deciding. Null for a rule whose window is never too small (BAD_SESSION_COUNT), and when the count could not be read right now. While isEvaluating is false, the rule opens and closes nothing. isEvaluating is also false while the rule is paused.
Show child attributes
Show child attributes