pydo.insights.create_notification_channel()

Generated on 13 Nov 2026 from pydo version v0.46.0

Usage

client.insights.create_notification_channel(
    body={
        "name": "Platform alerts",
        "email": {...},
        "slack": {...},
        ...,
    },
)
Returns JSON Raises HttpResponseError

Description

To create a notification channel, send a POST request to /v2/insights/notification-channels with a name and exactly one of email, slack, or webhook.

Email recipients must be team contact emails added and verified by a team owner. Webhook URLs must use HTTPS. Secret fields (slack.webhook_url, webhook credentials) are write-only. Subsequent reads never return secret values; they include optional *_status objects when a secret is configured.

Parameters

name string required

Example: Platform alerts

A human-readable name for the notification channel.

email object optional

Email notification channel configuration. Recipients must be team contact
emails added and verified by a team owner. They do not need to be team
members.

Show child properties
to string required

Example: [email protected], [email protected]

One or more recipient email addresses, separated by commas, semicolons,
or spaces.

slack object optional

Slack notification channel configuration for create and update requests.
webhook_url is write-only: send the full value to set or rotate. Omit
webhook_url on update to keep the existing secret.

Show child properties
webhook_url string optional

Example: https://hooks.slack.com/services/T000/B000/XXXXXXXX

Slack incoming webhook URL. Write-only secret — send the full value on
create or update. Omit on update to retain the existing value. Never
returned in responses.

channel string required

Example: #platform-alerts

The Slack channel name to notify.

webhook object optional

Generic HTTPS webhook notification channel configuration for create and
update requests. The URL must use HTTPS and must not include userinfo.
Optionally configure either basic_auth or bearer_token (not both),
custom headers, and a signing secret.

url is not a secret and is returned in full on read. Credential fields
(basic_auth.password, bearer_token.token, signature.secret) are
write-only: send the full value to set or rotate. Omit a secret field on
update to keep the existing value. Responses return nested *_status
objects instead of secret values.

Show child properties
url string required

Example: https://example.com/hook

HTTPS URL that receives webhook deliveries. Returned in full on read.

basic_auth object optional

HTTP basic authentication credentials for a webhook create or update
request. password is write-only: send the full value to set or rotate.
Omit password on update to keep the existing password.

Show child properties
username string required

Example: webhook-user

Basic auth username.

password string optional

Example: secret-password

Basic auth password. Write-only secret — send the full value on create
or update. Omit on update to retain the existing value. Never returned
in responses.

bearer_token object optional

Bearer token authentication for a webhook create or update request. token
is write-only: send the full value to set or rotate. Omit token on update
to keep the existing token.

Show child properties
token string optional

Example: secret-token

Bearer token value sent in the Authorization header. Write-only secret —
send the full value on create or update. Omit on update to retain the
existing value. Never returned in responses.

headers object optional

Example: {'X-Custom': '1'}

Optional custom HTTP headers to include on webhook deliveries. At most
20 headers are allowed. Reserved header names such as host,
content-type, and proxy-* are rejected.

signature object optional

Optional HMAC signature configuration for a webhook create or update
request. secret is write-only: send the full value to set or rotate. Omit
secret on update to keep the existing secret.

Show child properties
secret string optional

Example: whsec

Shared secret used to sign webhook payloads. Write-only secret — send
the full value on create or update. Omit on update to retain the
existing value. Never returned in responses.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "Platform alerts",
  "slack": {
    "webhook_url": "https://hooks.slack.com/services/T000/B000/XXXXXXXX",
    "channel": "#platform-alerts"
  }
}

resp = client.insights.create_notification_channel(body=req)

Response Example

Show Response Example
{
  "notification_channel": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "On-call email",
    "channel_type": "CHANNEL_TYPE_EMAIL",
    "email": {
      "to": "[email protected], [email protected]"
    },
    "usage": {
      "rule_count": 0
    },
    "created_at": "2026-09-03T10:15:00Z",
    "updated_at": "2026-09-03T10:15:00Z"
  }
}

More Information

See /v2/insights/notification-channels in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.