curl --request GET \
--url https://api.cloud.corbado.io/v1/observe/alertRuleTypes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloud.corbado.io/v1/observe/alertRuleTypes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cloud.corbado.io/v1/observe/alertRuleTypes', 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.cloud.corbado.io/v1/observe/alertRuleTypes",
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.cloud.corbado.io/v1/observe/alertRuleTypes"
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.cloud.corbado.io/v1/observe/alertRuleTypes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.corbado.io/v1/observe/alertRuleTypes")
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[
{
"ruleType": "login_success_rate",
"valueFormat": {
"unit": "percent",
"decimals": 1,
"suffix": "<string>"
},
"vocabulary": {
"value": {
"key": "<string>",
"name": "<string>",
"help": "<string>"
},
"measures": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
}
],
"minimum": {
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
},
"gateMeasure": "<string>",
"settings": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>"
}
]
},
"label": "<string>",
"measures": "<string>",
"description": "<string>",
"available": true,
"dimensions": [
{
"key": "<string>",
"name": "<string>"
}
],
"variants": [
{
"key": "<string>",
"name": "<string>",
"dimensions": [
{
"key": "<string>",
"name": "<string>"
}
],
"vocabulary": {
"value": {
"key": "<string>",
"name": "<string>",
"help": "<string>"
},
"measures": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
}
],
"minimum": {
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
},
"gateMeasure": "<string>",
"settings": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>"
}
]
}
}
]
}
]{
"error": {
"message": "Validation failed",
"details": [
{
"field": "projectID",
"message": "required"
}
]
}
}List alert rule types
Lists the alert rule types that can be created, described for the authenticated project. The rule builder renders itself from this: available says whether the project has the data the type reads, and dimensions are the keys a rule of that type can be grouped by here, including the project’s own time-series tags. A type with available false, or a groupBy key not listed here, is rejected when the rule is saved.
Required API key permission: observe:alerts:read.
curl --request GET \
--url https://api.cloud.corbado.io/v1/observe/alertRuleTypes \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloud.corbado.io/v1/observe/alertRuleTypes"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cloud.corbado.io/v1/observe/alertRuleTypes', 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.cloud.corbado.io/v1/observe/alertRuleTypes",
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.cloud.corbado.io/v1/observe/alertRuleTypes"
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.cloud.corbado.io/v1/observe/alertRuleTypes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.corbado.io/v1/observe/alertRuleTypes")
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[
{
"ruleType": "login_success_rate",
"valueFormat": {
"unit": "percent",
"decimals": 1,
"suffix": "<string>"
},
"vocabulary": {
"value": {
"key": "<string>",
"name": "<string>",
"help": "<string>"
},
"measures": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
}
],
"minimum": {
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
},
"gateMeasure": "<string>",
"settings": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>"
}
]
},
"label": "<string>",
"measures": "<string>",
"description": "<string>",
"available": true,
"dimensions": [
{
"key": "<string>",
"name": "<string>"
}
],
"variants": [
{
"key": "<string>",
"name": "<string>",
"dimensions": [
{
"key": "<string>",
"name": "<string>"
}
],
"vocabulary": {
"value": {
"key": "<string>",
"name": "<string>",
"help": "<string>"
},
"measures": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
}
],
"minimum": {
"key": "<string>",
"name": "<string>",
"help": "<string>",
"detailKey": "<string>",
"reference": true
},
"gateMeasure": "<string>",
"settings": [
{
"key": "<string>",
"name": "<string>",
"help": "<string>"
}
]
}
}
]
}
]{
"error": {
"message": "Validation failed",
"details": [
{
"field": "projectID",
"message": "required"
}
]
}
}Authorizations
Use an Observe API key from the management console. The key selects the project and must grant the permission listed on the operation. Keep this key on your server.
Response
Alert rule types, ordered by ruleType.
100Identifies the type; this is what a rule of this type stores in ruleType.
login_success_rate, relative_flow_count, relative_subflow_count, absolute_flow_count How the values and thresholds of a rule type are written for people. Values and thresholds stay raw numbers in every response; apply this to display them.
Show child attributes
Show child attributes
What the numbers and settings of a rule type are called, so every place that shows them names them the same way. A type with variants names them by the variant a rule picks ("Logins counted"), with the same term keys for every variant. What depends on other settings or on one evaluation, such as the length of the window, is not part of a term.
Show child attributes
Show child attributes
Human-readable name of the type, for the type picker.
What the type measures, as a short phrase (e.g. "completed logins / engaged logins").
One sentence on how a rule of this type works, for the rule builder.
Whether this project has the data this type reads. Rules of an unavailable type cannot be saved.
Keys a rule of this type can be grouped by for this project. Empty when available is false, and empty for a type with variants: there each variant lists its own.
100Show child attributes
Show child attributes
The choices a rule of this type makes in its settings that decide what it reads, for
relative_flow_count and absolute_flow_count the flowType, for relative_subflow_count
the subflowType. Only choices this project can be evaluated for are listed.
Empty for a type without variants.
1000Show child attributes
Show child attributes
Was this page helpful?