Patch Alert Rule
curl --request PATCH \
--url https://api.example.com/v1/alert-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"<string>"
],
"condition": {
"p_horizon_days": 2,
"threshold": 0.5,
"consecutive_runs": 1
},
"enabled": true,
"name": "<string>",
"scope": null,
"snoozed_until": "<string>",
"threshold": {
"probability": 0.5,
"window_days": 123
}
}
'import requests
url = "https://api.example.com/v1/alert-rules/{rule_id}"
payload = {
"channels": ["<string>"],
"condition": {
"p_horizon_days": 2,
"threshold": 0.5,
"consecutive_runs": 1
},
"enabled": True,
"name": "<string>",
"scope": None,
"snoozed_until": "<string>",
"threshold": {
"probability": 0.5,
"window_days": 123
}
}
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({
channels: ['<string>'],
condition: {p_horizon_days: 2, threshold: 0.5, consecutive_runs: 1},
enabled: true,
name: '<string>',
scope: null,
snoozed_until: '<string>',
threshold: {probability: 0.5, window_days: 123}
})
};
fetch('https://api.example.com/v1/alert-rules/{rule_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.example.com/v1/alert-rules/{rule_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([
'channels' => [
'<string>'
],
'condition' => [
'p_horizon_days' => 2,
'threshold' => 0.5,
'consecutive_runs' => 1
],
'enabled' => true,
'name' => '<string>',
'scope' => null,
'snoozed_until' => '<string>',
'threshold' => [
'probability' => 0.5,
'window_days' => 123
]
]),
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.example.com/v1/alert-rules/{rule_id}"
payload := strings.NewReader("{\n \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\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.example.com/v1/alert-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/alert-rules/{rule_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 \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}alert-rules
Patch Alert Rule
Partial update of an alert rule.
Validates any provided channels and snoozed_until before applying.
Returns the full updated entity. scope/condition validation branches
on the rule’s effective type (V2 Wave 5C type: "crest" vs legacy
type: "threshold") — type itself may also be part of this patch.
PATCH
/
v1
/
alert-rules
/
{rule_id}
Patch Alert Rule
curl --request PATCH \
--url https://api.example.com/v1/alert-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channels": [
"<string>"
],
"condition": {
"p_horizon_days": 2,
"threshold": 0.5,
"consecutive_runs": 1
},
"enabled": true,
"name": "<string>",
"scope": null,
"snoozed_until": "<string>",
"threshold": {
"probability": 0.5,
"window_days": 123
}
}
'import requests
url = "https://api.example.com/v1/alert-rules/{rule_id}"
payload = {
"channels": ["<string>"],
"condition": {
"p_horizon_days": 2,
"threshold": 0.5,
"consecutive_runs": 1
},
"enabled": True,
"name": "<string>",
"scope": None,
"snoozed_until": "<string>",
"threshold": {
"probability": 0.5,
"window_days": 123
}
}
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({
channels: ['<string>'],
condition: {p_horizon_days: 2, threshold: 0.5, consecutive_runs: 1},
enabled: true,
name: '<string>',
scope: null,
snoozed_until: '<string>',
threshold: {probability: 0.5, window_days: 123}
})
};
fetch('https://api.example.com/v1/alert-rules/{rule_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.example.com/v1/alert-rules/{rule_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([
'channels' => [
'<string>'
],
'condition' => [
'p_horizon_days' => 2,
'threshold' => 0.5,
'consecutive_runs' => 1
],
'enabled' => true,
'name' => '<string>',
'scope' => null,
'snoozed_until' => '<string>',
'threshold' => [
'probability' => 0.5,
'window_days' => 123
]
]),
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.example.com/v1/alert-rules/{rule_id}"
payload := strings.NewReader("{\n \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\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.example.com/v1/alert-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/alert-rules/{rule_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 \"channels\": [\n \"<string>\"\n ],\n \"condition\": {\n \"p_horizon_days\": 2,\n \"threshold\": 0.5,\n \"consecutive_runs\": 1\n },\n \"enabled\": true,\n \"name\": \"<string>\",\n \"scope\": null,\n \"snoozed_until\": \"<string>\",\n \"threshold\": {\n \"probability\": 0.5,\n \"window_days\": 123\n }\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Response
Successful Response
The response is of type Response Patch Alert Rule V1 Alert Rules Rule Id Patch · object.
⌘I