Update notification destination
/notification-destination/{id}
config is checked against type, or the stored type when type is left out. A config sent replaces the stored one, except that webhook_url, to, cc and bcc keep their stored values when left out (and a webhook_url sent as ******** does too).
Path Parameters
Request Body
Settings for the type. Each field is optional.
Replaces the destination's event types. An empty list, or leaving it out, keeps them. The response to this request still shows the previous event types; read the destination again to see the new ones.
allapi_errorsapi_token_eventsintegrated_account_eventswebhook_deactivatedapi_usage
slackemail
Response Body
The destination's settings. The shape depends on type.
Slack · 2 properties
For api_errors events, HTTP status codes not to notify about.
[404]A Slack incoming webhook URL. Returned masked as ********. A PATCH that sends ******** back, or leaves the field out, keeps the stored URL.
https://hooks.slack.com/services/T000/B000/XXXXEmail · 4 properties
[Truto]["alerts@example.com"]The notification event types this destination receives. all: every type. api_errors: failed integration API requests. api_token_events: expired tokens and a daily digest of unused ones. integrated_account_events: accounts that went stale and deletion reminders, at most one message a day per environment. webhook_deactivated: Truto turned off a failing webhook. api_usage: the monthly usage report.
["api_errors","integrated_account_events"]allapi_errorsapi_token_eventsintegrated_account_eventswebhook_deactivatedapi_usage
The ID of the notification destination.
Whether notifications are sent to this destination.
Ops channelslackemail
Errors
| Status | Description |
|---|---|
400 | Invalid config for the type. |
404 | Notification destination not found |
curl -X PATCH 'https://api.truto.one/notification-destination/{id}' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"type": "slack",
"config": {},
"label": "your_label",
"is_active": true,
"event_types": []
}'const body = {
"type": "slack",
"config": {},
"label": "your_label",
"is_active": true,
"event_types": []
};
const response = await fetch('https://api.truto.one/notification-destination/{id}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/notification-destination/{id}"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"type": "slack",
"config": {},
"label": "your_label",
"is_active": True,
"event_types": []
}
response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())