curl --request PATCH \
--url https://api.galtea.ai/monitors/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"versionId": "version_123",
"name": "Production quality watch",
"metricGroupIds": [
"metricGroup_123"
],
"specificationIds": [
"specification_123"
],
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE"
}
'import requests
url = "https://api.galtea.ai/monitors/{id}"
payload = {
"productId": "prod_123",
"versionId": "version_123",
"name": "Production quality watch",
"metricGroupIds": ["metricGroup_123"],
"specificationIds": ["specification_123"],
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: 'prod_123',
versionId: 'version_123',
name: 'Production quality watch',
metricGroupIds: ['metricGroup_123'],
specificationIds: ['specification_123'],
samplingPercentage: 10,
monthlyCreditCap: 500,
filterQuery: 'refund, cancel, chargeback',
filterTarget: 'EITHER',
excludeQuery: 'test, internal',
excludeTarget: 'EITHER',
status: 'ACTIVE'
})
};
fetch('https://api.galtea.ai/monitors/{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.galtea.ai/monitors/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'productId' => 'prod_123',
'versionId' => 'version_123',
'name' => 'Production quality watch',
'metricGroupIds' => [
'metricGroup_123'
],
'specificationIds' => [
'specification_123'
],
'samplingPercentage' => 10,
'monthlyCreditCap' => 500,
'filterQuery' => 'refund, cancel, chargeback',
'filterTarget' => 'EITHER',
'excludeQuery' => 'test, internal',
'excludeTarget' => 'EITHER',
'status' => 'ACTIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.galtea.ai/monitors/{id}"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.galtea.ai/monitors/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/monitors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "monitor_123",
"productId": "prod_123",
"versionId": "version_123",
"userId": "user_123",
"name": "Production quality watch",
"metricGroupIds": [
"metricGroup_123"
],
"specificationIds": [
"specification_123"
],
"scoredMetricGroupIds": [
"metricGroup_123"
],
"specificationIdsByMetricGroupId": {
"metricGroup_123": [
"specification_123"
]
},
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Update monitor
Update an existing monitor. Setting status to PAUSED or ACTIVE here still works; pause or resume with POST /monitors//pause and /monitors//resume instead. A list you send replaces the stored one: metricGroupIds the picked families, specificationIds the bound Specifications. See Monitors.
curl --request PATCH \
--url https://api.galtea.ai/monitors/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"productId": "prod_123",
"versionId": "version_123",
"name": "Production quality watch",
"metricGroupIds": [
"metricGroup_123"
],
"specificationIds": [
"specification_123"
],
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE"
}
'import requests
url = "https://api.galtea.ai/monitors/{id}"
payload = {
"productId": "prod_123",
"versionId": "version_123",
"name": "Production quality watch",
"metricGroupIds": ["metricGroup_123"],
"specificationIds": ["specification_123"],
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
productId: 'prod_123',
versionId: 'version_123',
name: 'Production quality watch',
metricGroupIds: ['metricGroup_123'],
specificationIds: ['specification_123'],
samplingPercentage: 10,
monthlyCreditCap: 500,
filterQuery: 'refund, cancel, chargeback',
filterTarget: 'EITHER',
excludeQuery: 'test, internal',
excludeTarget: 'EITHER',
status: 'ACTIVE'
})
};
fetch('https://api.galtea.ai/monitors/{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.galtea.ai/monitors/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'productId' => 'prod_123',
'versionId' => 'version_123',
'name' => 'Production quality watch',
'metricGroupIds' => [
'metricGroup_123'
],
'specificationIds' => [
'specification_123'
],
'samplingPercentage' => 10,
'monthlyCreditCap' => 500,
'filterQuery' => 'refund, cancel, chargeback',
'filterTarget' => 'EITHER',
'excludeQuery' => 'test, internal',
'excludeTarget' => 'EITHER',
'status' => 'ACTIVE'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.galtea.ai/monitors/{id}"
payload := strings.NewReader("{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.galtea.ai/monitors/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/monitors/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"productId\": \"prod_123\",\n \"versionId\": \"version_123\",\n \"name\": \"Production quality watch\",\n \"metricGroupIds\": [\n \"metricGroup_123\"\n ],\n \"specificationIds\": [\n \"specification_123\"\n ],\n \"samplingPercentage\": 10,\n \"monthlyCreditCap\": 500,\n \"filterQuery\": \"refund, cancel, chargeback\",\n \"filterTarget\": \"EITHER\",\n \"excludeQuery\": \"test, internal\",\n \"excludeTarget\": \"EITHER\",\n \"status\": \"ACTIVE\"\n}"
response = http.request(request)
puts response.read_body{
"id": "monitor_123",
"productId": "prod_123",
"versionId": "version_123",
"userId": "user_123",
"name": "Production quality watch",
"metricGroupIds": [
"metricGroup_123"
],
"specificationIds": [
"specification_123"
],
"scoredMetricGroupIds": [
"metricGroup_123"
],
"specificationIdsByMetricGroupId": {
"metricGroup_123": [
"specification_123"
]
},
"samplingPercentage": 10,
"monthlyCreditCap": 500,
"filterQuery": "refund, cancel, chargeback",
"filterTarget": "EITHER",
"excludeQuery": "test, internal",
"excludeTarget": "EITHER",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Body
The metric families (Metric.metricGroupId) picked directly on the monitor. The list may be empty when specificationIds is set. The families the monitor scores are in scoredMetricGroupIds. The monitor binds the family, not a specific revision, so revising a metric is picked up automatically without editing the monitor.
["metricGroup_123"]
The Specifications (Specification.id) bound to the monitor. The monitor also scores the metrics each one links, so a metric added to or removed from a Specification takes effect on the next scan. Only Policy and Capability Specifications can be bound. The update must leave the monitor with at least one family or Specification.
["specification_123"]
Optional content gate. Comma-separated terms; a session matches when at least one turn whose chosen target (filterTarget) contains ANY term (case-insensitive). Only matching sessions are sampled and evaluated; other sessions are skipped, spending no credits. Max 500 chars. Must be set together with filterTarget. Null means watch every session.
500"refund, cancel, chargeback"
Optional exclude gate. Comma-separated terms; a session is dropped when at least one turn whose chosen target (excludeTarget) contains ANY term (case-insensitive). Applied on top of filterQuery: a session is watched only when it passes filterQuery (if set) AND is not hit by excludeQuery. Max 500 chars. Must be set together with excludeTarget. Null means exclude nothing.
500"test, internal"
Response
Monitor updated successfully. The body holds only the monitor id when the read after the write fails; read the monitor by that id.
- Option 1
- Option 2
The metric families (Metric.metricGroupId) picked directly on the monitor. The list may be empty when specificationIds is set. The families the monitor scores are in scoredMetricGroupIds. The monitor binds the family, not a specific revision, so revising a metric is picked up automatically without editing the monitor.
["metricGroup_123"]
The Specifications (Specification.id) bound to the monitor. The monitor also scores the metrics each one links, so a metric added to or removed from a Specification takes effect on the next scan. Only Policy and Capability Specifications can be bound.
["specification_123"]
Optional content gate. Comma-separated terms; a session matches when at least one turn whose chosen target (filterTarget) contains ANY term (case-insensitive). Only matching sessions are sampled and evaluated; other sessions are skipped, spending no credits. Max 500 chars. Must be set together with filterTarget. Null means watch every session.
500"refund, cancel, chargeback"
Optional exclude gate. Comma-separated terms; a session is dropped when at least one turn whose chosen target (excludeTarget) contains ANY term (case-insensitive). Applied on top of filterQuery: a session is watched only when it passes filterQuery (if set) AND is not hit by excludeQuery. Max 500 chars. Must be set together with excludeTarget. Null means exclude nothing.
500"test, internal"