AIAutomations
Updates an AI automation
Requires OAuth scope ai.automations:write. Read-only attributes are ignored on write.
PUT
/
v1
/
ai_automations
/
{id}
Updates an AI automation
curl --request PUT \
--url https://api.rootly.com/v1/ai_automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": true,
"schedule": {
"hour": 11,
"timezone": "<string>"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"conditions": {
"any": [
{
"all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
]
}
]
},
"destination_slack_channel_id": "<string>",
"skill_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"limits_enabled": true,
"max_credits_per_run": 0,
"rate_limit_runs": 720
},
"id": "<string>"
}
}
'import requests
url = "https://api.rootly.com/v1/ai_automations/{id}"
payload = { "data": {
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": True,
"schedule": {
"hour": 11,
"timezone": "<string>"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"conditions": { "any": [{ "all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
] }] },
"destination_slack_channel_id": "<string>",
"skill_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"limits_enabled": True,
"max_credits_per_run": 0,
"rate_limit_runs": 720
},
"id": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'ai_automations',
attributes: {
name: '<string>',
prompt: '<string>',
enabled: true,
schedule: {hour: 11, timezone: '<string>'},
schedule_rrule: '<string>',
schedule_timezone: '<string>',
conditions: {any: [{all: [{field: 'status', operator: 'eq', value: 'started'}]}]},
destination_slack_channel_id: '<string>',
skill_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
limits_enabled: true,
max_credits_per_run: 0,
rate_limit_runs: 720
},
id: '<string>'
}
})
};
fetch('https://api.rootly.com/v1/ai_automations/{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/ai_automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'ai_automations',
'attributes' => [
'name' => '<string>',
'prompt' => '<string>',
'enabled' => true,
'schedule' => [
'hour' => 11,
'timezone' => '<string>'
],
'schedule_rrule' => '<string>',
'schedule_timezone' => '<string>',
'conditions' => [
'any' => [
[
'all' => [
[
'field' => 'status',
'operator' => 'eq',
'value' => 'started'
]
]
]
]
],
'destination_slack_channel_id' => '<string>',
'skill_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'limits_enabled' => true,
'max_credits_per_run' => 0,
'rate_limit_runs' => 720
],
'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/ai_automations/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.rootly.com/v1/ai_automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rootly.com/v1/ai_automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": true,
"trigger_kind": "schedule",
"schedule": {
"frequency": "hourly",
"hour": 11,
"weekday": "MO"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"event_name": "incident.created",
"conditions": {
"any": [
{
"all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
]
}
]
},
"destination_kind": "slack_channel",
"destination_slack_channel_id": "<string>",
"destination_slack_channel_name": "<string>",
"skill_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"limits_enabled": true,
"max_credits_per_run": 123,
"rate_limit_runs": 123,
"rate_limit_window": "1_hour",
"owner_user_id": 123,
"disabled_reason": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"consecutive_failures_count": 123,
"created_by_user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/vnd.api+json
Show child attributes
Show child attributes
Response
200 - application/vnd.api+json
event automation read representation round-trips through PUT
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Updates an AI automation
curl --request PUT \
--url https://api.rootly.com/v1/ai_automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": true,
"schedule": {
"hour": 11,
"timezone": "<string>"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"conditions": {
"any": [
{
"all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
]
}
]
},
"destination_slack_channel_id": "<string>",
"skill_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"limits_enabled": true,
"max_credits_per_run": 0,
"rate_limit_runs": 720
},
"id": "<string>"
}
}
'import requests
url = "https://api.rootly.com/v1/ai_automations/{id}"
payload = { "data": {
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": True,
"schedule": {
"hour": 11,
"timezone": "<string>"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"conditions": { "any": [{ "all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
] }] },
"destination_slack_channel_id": "<string>",
"skill_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"limits_enabled": True,
"max_credits_per_run": 0,
"rate_limit_runs": 720
},
"id": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'ai_automations',
attributes: {
name: '<string>',
prompt: '<string>',
enabled: true,
schedule: {hour: 11, timezone: '<string>'},
schedule_rrule: '<string>',
schedule_timezone: '<string>',
conditions: {any: [{all: [{field: 'status', operator: 'eq', value: 'started'}]}]},
destination_slack_channel_id: '<string>',
skill_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
limits_enabled: true,
max_credits_per_run: 0,
rate_limit_runs: 720
},
id: '<string>'
}
})
};
fetch('https://api.rootly.com/v1/ai_automations/{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/ai_automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'ai_automations',
'attributes' => [
'name' => '<string>',
'prompt' => '<string>',
'enabled' => true,
'schedule' => [
'hour' => 11,
'timezone' => '<string>'
],
'schedule_rrule' => '<string>',
'schedule_timezone' => '<string>',
'conditions' => [
'any' => [
[
'all' => [
[
'field' => 'status',
'operator' => 'eq',
'value' => 'started'
]
]
]
]
],
'destination_slack_channel_id' => '<string>',
'skill_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'limits_enabled' => true,
'max_credits_per_run' => 0,
'rate_limit_runs' => 720
],
'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/ai_automations/{id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.rootly.com/v1/ai_automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rootly.com/v1/ai_automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"ai_automations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"enabled\": true,\n \"schedule\": {\n \"hour\": 11,\n \"timezone\": \"<string>\"\n },\n \"schedule_rrule\": \"<string>\",\n \"schedule_timezone\": \"<string>\",\n \"conditions\": {\n \"any\": [\n {\n \"all\": [\n {\n \"field\": \"status\",\n \"operator\": \"eq\",\n \"value\": \"started\"\n }\n ]\n }\n ]\n },\n \"destination_slack_channel_id\": \"<string>\",\n \"skill_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"limits_enabled\": true,\n \"max_credits_per_run\": 0,\n \"rate_limit_runs\": 720\n },\n \"id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "ai_automations",
"attributes": {
"name": "<string>",
"prompt": "<string>",
"enabled": true,
"trigger_kind": "schedule",
"schedule": {
"frequency": "hourly",
"hour": 11,
"weekday": "MO"
},
"schedule_rrule": "<string>",
"schedule_timezone": "<string>",
"event_name": "incident.created",
"conditions": {
"any": [
{
"all": [
{
"field": "status",
"operator": "eq",
"value": "started"
}
]
}
]
},
"destination_kind": "slack_channel",
"destination_slack_channel_id": "<string>",
"destination_slack_channel_name": "<string>",
"skill_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"limits_enabled": true,
"max_credits_per_run": 123,
"rate_limit_runs": 123,
"rate_limit_window": "1_hour",
"owner_user_id": 123,
"disabled_reason": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"consecutive_failures_count": 123,
"created_by_user_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}
}