Update
Update an announcement template. Fields and actions are replaced wholesale, so send the full set you want.
curl --request PUT \
--url https://api.incident.io/v2/announcement_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
}
}
],
"name": "Major incidents",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
]
}
'import requests
url = "https://api.incident.io/v2/announcement_templates/{id}"
payload = {
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
}
}
],
"name": "Major incidents",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [{action_type: 'announcement_post_actions_homepage', emoji: 'slack', rank: 1}],
fields: [
{
custom_field_id: '01FCNDV6P870EA6S7TK1DSYDG0',
emoji: 'fire',
field_type: 'announcement_post_fields_status',
incident_role_id: '01FCNDV6P870EA6S7TK1DSYDG0',
incident_timestamp_id: '01FCNDV6P870EA6S7TK1DSYDG0',
rank: 1,
rich_text: {
contents: 'If you work on **payments**, please join {{incident.reference}}',
type: 'markdown'
}
}
],
name: 'Major incidents',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH']
})
};
fetch('https://api.incident.io/v2/announcement_templates/{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.incident.io/v2/announcement_templates/{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([
'actions' => [
[
'action_type' => 'announcement_post_actions_homepage',
'emoji' => 'slack',
'rank' => 1
]
],
'fields' => [
[
'custom_field_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'emoji' => 'fire',
'field_type' => 'announcement_post_fields_status',
'incident_role_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'incident_timestamp_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'rank' => 1,
'rich_text' => [
'contents' => 'If you work on **payments**, please join {{incident.reference}}',
'type' => 'markdown'
]
]
],
'name' => 'Major incidents',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
]
]),
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.incident.io/v2/announcement_templates/{id}"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.incident.io/v2/announcement_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/announcement_templates/{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/json'
request.body = "{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"announcement_template": {
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1,
"title": "Join channel"
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
},
"title": "Severity"
}
],
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"is_default": false,
"name": "Major incidents",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
]
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}announcement_templates.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Unique identifier for this announcement template
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
Actions shown on the announcement post. Send an empty array to remove them all.
Show child attributes
Show child attributes
[
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1
}
]
Fields shown on the announcement post. Send an empty array to remove them all.
Show child attributes
Show child attributes
[
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
}
}
]
Name of this announcement template, unique within the organisation
"Major incidents"
IDs of the teams that own this template. The existing owning teams are kept when omitted.
["01G0J1EXE7AXZ2C93K61WBPYEH"]
Response
OK response.
An announcement template controls which fields and actions appear on an announcement post.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PUT \
--url https://api.incident.io/v2/announcement_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
}
}
],
"name": "Major incidents",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
]
}
'import requests
url = "https://api.incident.io/v2/announcement_templates/{id}"
payload = {
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
}
}
],
"name": "Major incidents",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
actions: [{action_type: 'announcement_post_actions_homepage', emoji: 'slack', rank: 1}],
fields: [
{
custom_field_id: '01FCNDV6P870EA6S7TK1DSYDG0',
emoji: 'fire',
field_type: 'announcement_post_fields_status',
incident_role_id: '01FCNDV6P870EA6S7TK1DSYDG0',
incident_timestamp_id: '01FCNDV6P870EA6S7TK1DSYDG0',
rank: 1,
rich_text: {
contents: 'If you work on **payments**, please join {{incident.reference}}',
type: 'markdown'
}
}
],
name: 'Major incidents',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH']
})
};
fetch('https://api.incident.io/v2/announcement_templates/{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.incident.io/v2/announcement_templates/{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([
'actions' => [
[
'action_type' => 'announcement_post_actions_homepage',
'emoji' => 'slack',
'rank' => 1
]
],
'fields' => [
[
'custom_field_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'emoji' => 'fire',
'field_type' => 'announcement_post_fields_status',
'incident_role_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'incident_timestamp_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'rank' => 1,
'rich_text' => [
'contents' => 'If you work on **payments**, please join {{incident.reference}}',
'type' => 'markdown'
]
]
],
'name' => 'Major incidents',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
]
]),
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.incident.io/v2/announcement_templates/{id}"
payload := strings.NewReader("{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.incident.io/v2/announcement_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/announcement_templates/{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/json'
request.body = "{\n \"actions\": [\n {\n \"action_type\": \"announcement_post_actions_homepage\",\n \"emoji\": \"slack\",\n \"rank\": 1\n }\n ],\n \"fields\": [\n {\n \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"emoji\": \"fire\",\n \"field_type\": \"announcement_post_fields_status\",\n \"incident_role_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"incident_timestamp_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"rank\": 1,\n \"rich_text\": {\n \"contents\": \"If you work on **payments**, please join {{incident.reference}}\",\n \"type\": \"markdown\"\n }\n }\n ],\n \"name\": \"Major incidents\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"announcement_template": {
"actions": [
{
"action_type": "announcement_post_actions_homepage",
"emoji": "slack",
"rank": 1,
"title": "Join channel"
}
],
"fields": [
{
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"emoji": "fire",
"field_type": "announcement_post_fields_status",
"incident_role_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"incident_timestamp_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"rank": 1,
"rich_text": {
"contents": "If you work on **payments**, please join {{incident.reference}}",
"type": "markdown"
},
"title": "Severity"
}
],
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"is_default": false,
"name": "Major incidents",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
]
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}