Save a notification destination
Org owners and admins only. Replaces the destination’s name, routes and, for email lists, members and roles in one change; nothing is saved when any part is invalid. Omit url or routing_key to keep the current one. A webhook keeps its signing secret when its URL changes. A destination receives a notification when any route matches its kind (exact, a category such as cost.*, or *), minimum severity, minimum monthly cost impact in USD, tenant and virtual tag value. The minimum cost impact only filters notifications that carry a cost impact, such as anomalies; budget, forecast and infrastructure notifications are never held back by it. A route without a tenant covers every tenant; a tag filter requires a tenant. Roles are resolved to members when a notification is sent; members without access to a notification’s tenant are skipped.
curl --request PUT \
--url https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"member_ids": [
"<string>"
],
"roles": [
"<string>"
],
"routes": [
{
"kind_pattern": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"routing_key": "<string>",
"url": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}"
payload = {
"name": "<string>",
"member_ids": ["<string>"],
"roles": ["<string>"],
"routes": [
{
"kind_pattern": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"routing_key": "<string>",
"url": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
member_ids: ['<string>'],
roles: ['<string>'],
routes: [
{
kind_pattern: '<string>',
min_cost_impact: 123,
min_severity: '<string>',
tag_key: '<string>',
tag_value: '<string>',
tenant_id: '<string>'
}
],
routing_key: '<string>',
url: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{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([
'name' => '<string>',
'member_ids' => [
'<string>'
],
'roles' => [
'<string>'
],
'routes' => [
[
'kind_pattern' => '<string>',
'min_cost_impact' => 123,
'min_severity' => '<string>',
'tag_key' => '<string>',
'tag_value' => '<string>',
'tenant_id' => '<string>'
]
],
'routing_key' => '<string>',
'url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"addresses": [
{
"confirmed": true,
"email": "<string>",
"id": "<string>",
"confirmation_sent_at": "<string>"
}
],
"config": {},
"created_at": "<string>",
"enabled": true,
"health": {
"status": "delivering",
"waiting": 123,
"last_delivered_at": "<string>",
"last_failure_at": "<string>",
"last_failure_reason": "<string>"
},
"id": "<string>",
"kind": "slack",
"member_ids": [
"<string>"
],
"name": "<string>",
"organization_id": "<string>",
"roles": [
"<string>"
],
"routes": [
{
"id": "<string>",
"kind_pattern": "<string>",
"min_cost_impact_currency": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"updated_at": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Body
Destination
Was this page helpful?
curl --request PUT \
--url https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"member_ids": [
"<string>"
],
"roles": [
"<string>"
],
"routes": [
{
"kind_pattern": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"routing_key": "<string>",
"url": "<string>"
}
'import requests
url = "https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}"
payload = {
"name": "<string>",
"member_ids": ["<string>"],
"roles": ["<string>"],
"routes": [
{
"kind_pattern": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"routing_key": "<string>",
"url": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
member_ids: ['<string>'],
roles: ['<string>'],
routes: [
{
kind_pattern: '<string>',
min_cost_impact: 123,
min_severity: '<string>',
tag_key: '<string>',
tag_value: '<string>',
tenant_id: '<string>'
}
],
routing_key: '<string>',
url: '<string>'
})
};
fetch('https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{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([
'name' => '<string>',
'member_ids' => [
'<string>'
],
'roles' => [
'<string>'
],
'routes' => [
[
'kind_pattern' => '<string>',
'min_cost_impact' => 123,
'min_severity' => '<string>',
'tag_key' => '<string>',
'tag_value' => '<string>',
'tenant_id' => '<string>'
]
],
'routing_key' => '<string>',
'url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/organizations/{org_id}/notifications/destinations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"member_ids\": [\n \"<string>\"\n ],\n \"roles\": [\n \"<string>\"\n ],\n \"routes\": [\n {\n \"kind_pattern\": \"<string>\",\n \"min_cost_impact\": 123,\n \"min_severity\": \"<string>\",\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"tenant_id\": \"<string>\"\n }\n ],\n \"routing_key\": \"<string>\",\n \"url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"addresses": [
{
"confirmed": true,
"email": "<string>",
"id": "<string>",
"confirmation_sent_at": "<string>"
}
],
"config": {},
"created_at": "<string>",
"enabled": true,
"health": {
"status": "delivering",
"waiting": 123,
"last_delivered_at": "<string>",
"last_failure_at": "<string>",
"last_failure_reason": "<string>"
},
"id": "<string>",
"kind": "slack",
"member_ids": [
"<string>"
],
"name": "<string>",
"organization_id": "<string>",
"roles": [
"<string>"
],
"routes": [
{
"id": "<string>",
"kind_pattern": "<string>",
"min_cost_impact_currency": "<string>",
"min_cost_impact": 123,
"min_severity": "<string>",
"tag_key": "<string>",
"tag_value": "<string>",
"tenant_id": "<string>"
}
],
"updated_at": "<string>"
}
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}