curl --request GET \
--url https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_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": "01HXKZ4M5N6P7Q8R9STVWXYZAB",
"status": "ACTIVE",
"detection_method": "EWMA",
"sigma_threshold": 123,
"direction": "BOTH",
"created_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z",
"metric_id": "<string>",
"agent_id": "<string>",
"test_set_id": "<string>",
"persona_id": "<string>",
"display_name": "<string>",
"baseline_float": 123,
"baseline_sigma": 123,
"observation_count": 0,
"sigma_bands": {},
"last_processed_run_completed_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": "NOT_FOUND",
"message": "Metric not found",
"details": [
{
"field": "metric_id",
"description": "No metric found with this ID"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error"
}
}Get metric baseline
Retrieve a single anomaly-detection baseline by ID.
curl --request GET \
--url https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_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/metrics/{metric_id}/baselines/{baseline_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/metrics/{metric_id}/baselines/{baseline_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": "01HXKZ4M5N6P7Q8R9STVWXYZAB",
"status": "ACTIVE",
"detection_method": "EWMA",
"sigma_threshold": 123,
"direction": "BOTH",
"created_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z",
"metric_id": "<string>",
"agent_id": "<string>",
"test_set_id": "<string>",
"persona_id": "<string>",
"display_name": "<string>",
"baseline_float": 123,
"baseline_sigma": 123,
"observation_count": 0,
"sigma_bands": {},
"last_processed_run_completed_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": "NOT_FOUND",
"message": "Metric not found",
"details": [
{
"field": "metric_id",
"description": "No metric found with this ID"
}
]
}
}{
"error": {
"code": "INTERNAL",
"message": "Internal server error"
}
}Authorizations
API key for authentication
Path Parameters
22-character metric ID
^[a-zA-Z0-9]{22}$26-character baseline ULID.
26Query Parameters
Comma-separated sigma multipliers used to populate sigma_bands in each baseline (e.g. 1,2,3).
Response
Baseline retrieved successfully
Anomaly-detection baseline for a metric.
Baseline ULID.
"01HXKZ4M5N6P7Q8R9STVWXYZAB"
Baseline lifecycle status.
ACTIVE, STANDBY, ARCHIVED Anomaly detection algorithm. Currently only EWMA.
EWMA Sigmas from the baseline that constitute an anomaly.
Which direction(s) of deviation count as anomalous.
BOTH, ABOVE, BELOW Metric ULID.
Agent ID. Null for org-wide baselines.
Test set ULID. Null for monitoring.
Persona ULID. Null when the baseline covers all personas.
User-facing label.
Current baseline mean estimate.
Current baseline standard deviation estimate.
Number of observations processed.
Computed sigma bands keyed by level (e.g. upper_1sigma, lower_2sigma,
upper_2sigma). Null when baseline stats are not yet populated. Levels
controlled by the sigma_levels query param.
Show child attributes
Show child attributes
Cursor: when the last processed run completed.
Was this page helpful?