curl --request POST \
--url https://api.getbluejay.ai/v1/create-alert \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"name": "<string>",
"entity_field": "<string>",
"comparison_value": "<string>",
"sample_size": 123,
"description": "<string>",
"is_enabled": true,
"notification_channels": [
{
"type": "<string>",
"target": "<string>"
}
],
"applies_to_all_agents": true,
"agent_ids": [
123
],
"simulation_id": 123,
"threshold_time_interval": 123,
"min_events": 123,
"min_events_type": "events",
"source_scope": "all"
}
'import requests
url = "https://api.getbluejay.ai/v1/create-alert"
payload = {
"name": "<string>",
"entity_field": "<string>",
"comparison_value": "<string>",
"sample_size": 123,
"description": "<string>",
"is_enabled": True,
"notification_channels": [
{
"type": "<string>",
"target": "<string>"
}
],
"applies_to_all_agents": True,
"agent_ids": [123],
"simulation_id": 123,
"threshold_time_interval": 123,
"min_events": 123,
"min_events_type": "events",
"source_scope": "all"
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
entity_field: '<string>',
comparison_value: '<string>',
sample_size: 123,
description: '<string>',
is_enabled: true,
notification_channels: [{type: '<string>', target: '<string>'}],
applies_to_all_agents: true,
agent_ids: [123],
simulation_id: 123,
threshold_time_interval: 123,
min_events: 123,
min_events_type: 'events',
source_scope: 'all'
})
};
fetch('https://api.getbluejay.ai/v1/create-alert', 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.getbluejay.ai/v1/create-alert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'entity_field' => '<string>',
'comparison_value' => '<string>',
'sample_size' => 123,
'description' => '<string>',
'is_enabled' => true,
'notification_channels' => [
[
'type' => '<string>',
'target' => '<string>'
]
],
'applies_to_all_agents' => true,
'agent_ids' => [
123
],
'simulation_id' => 123,
'threshold_time_interval' => 123,
'min_events' => 123,
'min_events_type' => 'events',
'source_scope' => 'all'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getbluejay.ai/v1/create-alert"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getbluejay.ai/v1/create-alert")
.header("X-API-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getbluejay.ai/v1/create-alert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"is_enabled": true,
"organization_id": "<string>",
"entity_type": "standard_metric",
"entity_field": "<string>",
"operator": "equals",
"comparison_value": "<string>",
"notification_channels": [
"<unknown>"
],
"trigger_count": 123,
"applies_to_all_agents": true,
"created_at": "2023-11-07T05:31:56Z",
"threshold_time_interval": 123,
"min_events": 123,
"in_alert": true,
"description": "<string>",
"last_triggered_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agents": [
123
],
"simulation_id": 123,
"evaluation_scope": "<string>",
"aggregation": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"min_events_type": "events",
"source_scope": "all",
"simulation_name": "<string>",
"sample_size": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Create Alert
Create an observability or simulation alert for your organization.
curl --request POST \
--url https://api.getbluejay.ai/v1/create-alert \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"name": "<string>",
"entity_field": "<string>",
"comparison_value": "<string>",
"sample_size": 123,
"description": "<string>",
"is_enabled": true,
"notification_channels": [
{
"type": "<string>",
"target": "<string>"
}
],
"applies_to_all_agents": true,
"agent_ids": [
123
],
"simulation_id": 123,
"threshold_time_interval": 123,
"min_events": 123,
"min_events_type": "events",
"source_scope": "all"
}
'import requests
url = "https://api.getbluejay.ai/v1/create-alert"
payload = {
"name": "<string>",
"entity_field": "<string>",
"comparison_value": "<string>",
"sample_size": 123,
"description": "<string>",
"is_enabled": True,
"notification_channels": [
{
"type": "<string>",
"target": "<string>"
}
],
"applies_to_all_agents": True,
"agent_ids": [123],
"simulation_id": 123,
"threshold_time_interval": 123,
"min_events": 123,
"min_events_type": "events",
"source_scope": "all"
}
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
entity_field: '<string>',
comparison_value: '<string>',
sample_size: 123,
description: '<string>',
is_enabled: true,
notification_channels: [{type: '<string>', target: '<string>'}],
applies_to_all_agents: true,
agent_ids: [123],
simulation_id: 123,
threshold_time_interval: 123,
min_events: 123,
min_events_type: 'events',
source_scope: 'all'
})
};
fetch('https://api.getbluejay.ai/v1/create-alert', 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.getbluejay.ai/v1/create-alert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'entity_field' => '<string>',
'comparison_value' => '<string>',
'sample_size' => 123,
'description' => '<string>',
'is_enabled' => true,
'notification_channels' => [
[
'type' => '<string>',
'target' => '<string>'
]
],
'applies_to_all_agents' => true,
'agent_ids' => [
123
],
'simulation_id' => 123,
'threshold_time_interval' => 123,
'min_events' => 123,
'min_events_type' => 'events',
'source_scope' => 'all'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getbluejay.ai/v1/create-alert"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getbluejay.ai/v1/create-alert")
.header("X-API-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getbluejay.ai/v1/create-alert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"entity_field\": \"<string>\",\n \"comparison_value\": \"<string>\",\n \"sample_size\": 123,\n \"description\": \"<string>\",\n \"is_enabled\": true,\n \"notification_channels\": [\n {\n \"type\": \"<string>\",\n \"target\": \"<string>\"\n }\n ],\n \"applies_to_all_agents\": true,\n \"agent_ids\": [\n 123\n ],\n \"simulation_id\": 123,\n \"threshold_time_interval\": 123,\n \"min_events\": 123,\n \"min_events_type\": \"events\",\n \"source_scope\": \"all\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"is_enabled": true,
"organization_id": "<string>",
"entity_type": "standard_metric",
"entity_field": "<string>",
"operator": "equals",
"comparison_value": "<string>",
"notification_channels": [
"<unknown>"
],
"trigger_count": 123,
"applies_to_all_agents": true,
"created_at": "2023-11-07T05:31:56Z",
"threshold_time_interval": 123,
"min_events": 123,
"in_alert": true,
"description": "<string>",
"last_triggered_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"agents": [
123
],
"simulation_id": 123,
"evaluation_scope": "<string>",
"aggregation": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"min_events_type": "events",
"source_scope": "all",
"simulation_name": "<string>",
"sample_size": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
Request model for creating an alert
Name of the alert
Type of entity being monitored
standard_metric, custom_goal, custom_metric, metadata_field, system_failure The specific field/metric being monitored
Comparison operator
equals, not_equals, greater_than, less_than, greater_than_or_equal, less_than_or_equal, contains, not_contains Value to compare against
Evaluate over the most recent N conversations instead of a time window (minimum 30). NULL keeps the time-window behavior; the alert never fires with fewer than N conversations.
Description of the alert
Whether the alert is enabled
Notification channels configuration
Show child attributes
Show child attributes
Whether the alert applies to all agents
Agent IDs to associate with this alert (only used when applies_to_all_agents=False)
Optional experiments.id (simulation) to scope simulation alerts to. NULL means agent-scoped across all simulations.
How this alert is evaluated. Only 'per_simulation_run' is supported.
per_test_result, per_simulation_run, per_simulation_run_window Aggregation mode used to compute the per-run metric value from test results within the run.
none, avg, max, min, count For observability source_scope: time window in seconds (default 600 if omitted). For simulation source_scope: K = number of recent completed runs (default 1 if omitted).
Minimum number of events for the alert. Only meaningful for observability/all source_scope (default 10 if omitted). Forced to NULL for simulation source_scope.
Whether min_events is an absolute count ('events') or a percentage ('percentage')
events, percentage Which data source fires this alert: 'all', 'observability', or 'simulation'
all, observability, simulation Response
Successful Response
Response model for alert operations
Unique identifier for the alert
Name of the alert
Whether the alert is enabled
Organization ID
Type of entity being monitored
standard_metric, custom_goal, custom_metric, metadata_field, system_failure The specific field/metric being monitored
Comparison operator
equals, not_equals, greater_than, less_than, greater_than_or_equal, less_than_or_equal, contains, not_contains Value to compare against
Notification channels configuration
Number of times triggered
Whether the alert applies to all agents
When the alert was created
For observability source_scope: time window in seconds. For simulation source_scope: K = number of recent completed runs.
The minimum number of events for the alert. NULL for simulation alerts.
Whether the alert is in alert
Description of the alert
When the alert was last triggered
User who created the alert
Associated agent IDs
Optional experiments.id (simulation) this alert is scoped to
How this alert is evaluated. Only 'per_simulation_run' is supported.
Aggregation mode used to compute the per-run metric value from test results within the run.
When the alert was last updated
User who last updated the alert
Whether min_events is an absolute count or a percentage
Which data source fires this alert: 'all', 'observability', or 'simulation'
Name of the simulation (experiment) this alert is scoped to, if any
Most recent N conversations the alert is evaluated over; NULL = time window