curl --request GET \
--url https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics"
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/alertInstanceStatistics', 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/alertInstanceStatistics",
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/alertInstanceStatistics"
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/alertInstanceStatistics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics")
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{
"series": [
{
"bucketStartMs": 123,
"evaluationCount": 123,
"normalCount": 123,
"pendingCount": 123,
"firingCount": 123,
"noDataCount": 123,
"errorCount": 123,
"minValue": 123,
"avgValue": 123,
"maxValue": 123,
"thresholdValue": 123
}
],
"phases": [
{
"fromMs": 123,
"toMs": 123,
"status": "normal",
"severity": "info"
}
],
"totals": {
"normalMs": 123,
"pendingMs": 123,
"firingMs": 123,
"noDataMs": 123,
"errorMs": 123,
"firingCount": 123
},
"thresholdValue": 123
}{
"error": {
"message": "Validation failed",
"details": [
{
"field": "projectID",
"message": "required"
}
]
}
}Get alert instance statistics
Returns an alert instance’s hourly evaluation aggregates and status timeline with per-status totals.
Only evaluated hours have buckets. The timeline starts with the status held at fromMs, using the
last preceding transition. Evaluations have shorter retention than transitions; expired history
returns empty results rather than an error.
Required API key permission: observe:alerts:read.
curl --request GET \
--url https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics"
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/alertInstanceStatistics', 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/alertInstanceStatistics",
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/alertInstanceStatistics"
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/alertInstanceStatistics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.corbado.io/v1/observe/alertInstanceStatistics")
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{
"series": [
{
"bucketStartMs": 123,
"evaluationCount": 123,
"normalCount": 123,
"pendingCount": 123,
"firingCount": 123,
"noDataCount": 123,
"errorCount": 123,
"minValue": 123,
"avgValue": 123,
"maxValue": 123,
"thresholdValue": 123
}
],
"phases": [
{
"fromMs": 123,
"toMs": 123,
"status": "normal",
"severity": "info"
}
],
"totals": {
"normalMs": 123,
"pendingMs": 123,
"firingMs": 123,
"noDataMs": 123,
"errorMs": 123,
"firingCount": 123
},
"thresholdValue": 123
}{
"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.
Query Parameters
The alert instance to describe (format ain-<number>).
Window start (epoch ms, inclusive).
Window end (epoch ms, exclusive). Must be after fromMs; the window may span at most 366 days.
Response
Statistics for the alert instance over the window.
One alert instance's history over a requested window, in the two shapes the statistics panel draws: an hourly-bucketed evaluation series for the value chart, and the status timeline as merged phases plus per-status totals. The series carries only the hours that have evaluations; the phases jointly cover the window from the first known status to the earlier of the window's end and now.
2500Show child attributes
Show child attributes
10000Show child attributes
Show child attributes
How long the instance spent in each status within the window, and how often it fired. Every field is present, zero included, and the durations add up to the covered part of the window - the stretch before the instance existed, or after now, is in none of them.
Show child attributes
Show child attributes
The instance's current threshold, for the chart's reference line. Absent when no band applies.
Was this page helpful?