AlertGroups
Update an alert group
Update a specific alert group by id. Note: For enhanced functionality and future compatibility, consider using the advanced alert grouping with conditions field instead of the legacy group_by_alert_title, group_by_alert_urgency, and attributes fields.
PATCH
/
v1
/
alert_groups
/
{id}
Update an alert group
curl --request PATCH \
--url https://api.rootly.com/v1/alert_groups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"time_window": 123,
"targets": [
{
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"attributes": [
{
"json_path": "<string>"
}
],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": [
"<string>"
],
"alert_urgency_ids": [
"<string>"
],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
}
}
'import requests
url = "https://api.rootly.com/v1/alert_groups/{id}"
payload = { "data": {
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"time_window": 123,
"targets": [{ "target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }],
"attributes": [{ "json_path": "<string>" }],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": ["<string>"],
"alert_urgency_ids": ["<string>"],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'alert_groups',
attributes: {
name: '<string>',
description: '<string>',
time_window: 123,
targets: [{target_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
attributes: [{json_path: '<string>'}],
conditions: [
{
property_field_name: '<string>',
property_field_value: '<string>',
property_field_values: ['<string>'],
alert_urgency_ids: ['<string>'],
conditionable_type: 'AlertField',
conditionable_id: '<string>'
}
]
}
}
})
};
fetch('https://api.rootly.com/v1/alert_groups/{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.rootly.com/v1/alert_groups/{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([
'data' => [
'type' => 'alert_groups',
'attributes' => [
'name' => '<string>',
'description' => '<string>',
'time_window' => 123,
'targets' => [
[
'target_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'attributes' => [
[
'json_path' => '<string>'
]
],
'conditions' => [
[
'property_field_name' => '<string>',
'property_field_value' => '<string>',
'property_field_values' => [
'<string>'
],
'alert_urgency_ids' => [
'<string>'
],
'conditionable_type' => 'AlertField',
'conditionable_id' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.rootly.com/v1/alert_groups/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.rootly.com/v1/alert_groups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rootly.com/v1/alert_groups/{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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"condition_type": "<string>",
"time_window": 123,
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>",
"slug": "<string>",
"group_by_alert_title": true,
"group_by_alert_urgency": true,
"targets": [
{
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"attributes": [
{
"json_path": "<string>"
}
],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": [
"<string>"
],
"values": [
{
"record_id": "<string>",
"record_type": "<string>"
}
],
"alert_urgency_ids": [
"<string>"
],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
},
"included": [
{
"id": "<string>",
"type": "<string>",
"attributes": {},
"relationships": {}
}
]
}{
"errors": [
{
"title": "<string>",
"status": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Resource UUID
Body
application/vnd.api+json
Show child attributes
Show child attributes
Was this page helpful?
Previous
List alert routesList all alert routes for the current team with filtering and pagination. **Note: This endpoint requires access to Advanced Alert Routing. If you're unsure whether you have access to this feature, please contact Rootly customer support.**
Next
⌘I
Update an alert group
curl --request PATCH \
--url https://api.rootly.com/v1/alert_groups/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"time_window": 123,
"targets": [
{
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"attributes": [
{
"json_path": "<string>"
}
],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": [
"<string>"
],
"alert_urgency_ids": [
"<string>"
],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
}
}
'import requests
url = "https://api.rootly.com/v1/alert_groups/{id}"
payload = { "data": {
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"time_window": 123,
"targets": [{ "target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }],
"attributes": [{ "json_path": "<string>" }],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": ["<string>"],
"alert_urgency_ids": ["<string>"],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'alert_groups',
attributes: {
name: '<string>',
description: '<string>',
time_window: 123,
targets: [{target_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}],
attributes: [{json_path: '<string>'}],
conditions: [
{
property_field_name: '<string>',
property_field_value: '<string>',
property_field_values: ['<string>'],
alert_urgency_ids: ['<string>'],
conditionable_type: 'AlertField',
conditionable_id: '<string>'
}
]
}
}
})
};
fetch('https://api.rootly.com/v1/alert_groups/{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.rootly.com/v1/alert_groups/{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([
'data' => [
'type' => 'alert_groups',
'attributes' => [
'name' => '<string>',
'description' => '<string>',
'time_window' => 123,
'targets' => [
[
'target_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'attributes' => [
[
'json_path' => '<string>'
]
],
'conditions' => [
[
'property_field_name' => '<string>',
'property_field_value' => '<string>',
'property_field_values' => [
'<string>'
],
'alert_urgency_ids' => [
'<string>'
],
'conditionable_type' => 'AlertField',
'conditionable_id' => '<string>'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.rootly.com/v1/alert_groups/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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.rootly.com/v1/alert_groups/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rootly.com/v1/alert_groups/{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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"alert_groups\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"time_window\": 123,\n \"targets\": [\n {\n \"target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"attributes\": [\n {\n \"json_path\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"property_field_name\": \"<string>\",\n \"property_field_value\": \"<string>\",\n \"property_field_values\": [\n \"<string>\"\n ],\n \"alert_urgency_ids\": [\n \"<string>\"\n ],\n \"conditionable_type\": \"AlertField\",\n \"conditionable_id\": \"<string>\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "alert_groups",
"attributes": {
"name": "<string>",
"description": "<string>",
"condition_type": "<string>",
"time_window": 123,
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>",
"slug": "<string>",
"group_by_alert_title": true,
"group_by_alert_urgency": true,
"targets": [
{
"target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"attributes": [
{
"json_path": "<string>"
}
],
"conditions": [
{
"property_field_name": "<string>",
"property_field_value": "<string>",
"property_field_values": [
"<string>"
],
"values": [
{
"record_id": "<string>",
"record_type": "<string>"
}
],
"alert_urgency_ids": [
"<string>"
],
"conditionable_type": "AlertField",
"conditionable_id": "<string>"
}
]
}
},
"included": [
{
"id": "<string>",
"type": "<string>",
"attributes": {},
"relationships": {}
}
]
}{
"errors": [
{
"title": "<string>",
"status": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}