Skip to content
POST /notification-destination

An API token creates the destination in its own environment; a dashboard session must pass environment_id.

Request Body

configobject

Chosen by type. An unknown key is a 400.

One of
Slack · 2 properties
ignored_status_codesnumber[]

For api_errors events, HTTP status codes not to notify about.

Example: [404]
webhook_urlstring

A Slack incoming webhook URL. Returned masked as ********. A PATCH that sends ******** back, or leaves the field out, keeps the stored URL.

Example: https://hooks.slack.com/services/T000/B000/XXXX
Email · 4 properties
bccstring[]
ccstring[]
subject_prefixstring
Example: [Truto]
tostring[]
Example: ["alerts@example.com"]
environment_idstring · uuid

Required for a dashboard session; ignored for API tokens.

event_typesstring[]

The notification event types to send. Defaults to all. See event_types on the notification destination for what each one covers. Nothing checks the names before the destination is saved, so use only these values.

Example: ["api_errors","integrated_account_events"]
Possible values:
allapi_errorsapi_token_eventsintegrated_account_eventswebhook_deactivatedapi_usage
is_activeboolean
labelstring
typestring
Possible values:
slackemail

Response Body

configobject

The destination's settings. The shape depends on type.

One of
Slack · 2 properties
ignored_status_codesnumber[]

For api_errors events, HTTP status codes not to notify about.

Example: [404]
webhook_urlstring

A Slack incoming webhook URL. Returned masked as ********. A PATCH that sends ******** back, or leaves the field out, keeps the stored URL.

Example: https://hooks.slack.com/services/T000/B000/XXXX
Email · 4 properties
bccstring[]
ccstring[]
subject_prefixstring
Example: [Truto]
tostring[]
Example: ["alerts@example.com"]
created_atstring · date-time
environment_idstring · uuid
event_typesstring[]

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.

Example: ["api_errors","integrated_account_events"]
Possible values:
allapi_errorsapi_token_eventsintegrated_account_eventswebhook_deactivatedapi_usage
idstring · uuid

The ID of the notification destination.

is_activeboolean

Whether notifications are sent to this destination.

labelstring
Example: Ops channel
typestring
Possible values:
slackemail
updated_atstring · date-time

Errors

StatusDescription
400Invalid type or config, or config.webhook_url sent as the masked ********.
403environment_id is not one of yours.
curl -X POST 'https://api.truto.one/notification-destination' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "slack",
  "label": "your_label",
  "is_active": true,
  "event_types": [
    "api_errors",
    "integrated_account_events"
  ],
  "environment_id": "your_environment_id"
}'
const body = {
  "type": "slack",
  "label": "your_label",
  "is_active": true,
  "event_types": [
    "api_errors",
    "integrated_account_events"
  ],
  "environment_id": "your_environment_id"
};

const response = await fetch('https://api.truto.one/notification-destination', {
  method: 'POST',
  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"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "type": "slack",
    "label": "your_label",
    "is_active": True,
    "event_types": [
        "api_errors",
        "integrated_account_events"
    ],
    "environment_id": "your_environment_id"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())