Create Notification Channel
Creates a new notification channel. Secrets in config are encrypted server-side.
POST /api/notification-channels
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | — | Channel type (see full list below) |
name | string | Yes | — | Display name |
config | object|string | Yes | — | Channel configuration (see type table). Pass as JSON object or JSON string. |
organizationId | number | No | from session | Organization scope |
customerId | number | No | null | Customer scope |
websiteId | number | No | null | Website scope. Requires sourceChannelId. |
sourceChannelId | number|string | Conditional | null | Parent channel ID for website overrides |
category | string | No | direct | direct or integration |
priority | number | No | 1 | Lower = higher priority |
delaySeconds | number | No | 0 | Delay before sending alert |
conditions | object|string | No | null | Alert conditions (e.g., {"onlyFullService": true, "minIncidentDuration": 300}) |
isActive | boolean | No | true | Whether the channel is active |
Channel types
Direct (category: "direct"): email, sms, webhook.
Integrations (category: "integration"): slack, discord, teams, pagerduty, opsgenie, allquiet, telegram, googlechat, mattermost, rocketchat, matrix, lark, dingtalk, wecom, ilert, grafanaoncall, squadcast, incidentio, pushover, ntfy, gotify, jira, github, gitlab, linear, servicenow.
The config fields depend on the type — see Integrations for what each channel needs. You can validate a channel before saving with the Test Notification Channel endpoint.
Example (cURL) — Email channel
curl -X POST "$BASE_URL/api/notification-channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"name": "Ops Email",
"config": { "email": "ops@example.com", "to": "Ops Team" },
"organizationId": 1
}'Example (cURL) — Slack channel
curl -X POST "$BASE_URL/api/notification-channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "slack",
"name": "Alerts Slack Channel",
"config": { "secret": "https://hooks.slack.com/services/T00/B00/xxx" },
"organizationId": 1
}'Example (cURL) — Webhook channel
curl -X POST "$BASE_URL/api/notification-channels" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "webhook",
"name": "Custom Webhook",
"config": {
"url": "https://example.com/webhook",
"method": "POST",
"headers": { "X-Custom-Header": "value" },
"bodyTemplate": "{\"text\": \"{{websiteName}} is {{status}}\"}",
"timeout": 30,
"retryAttempts": 3,
"retryDelay": 60,
"expectedStatusCodes": "200,201,204"
},
"organizationId": 1
}'Common errors
401 Unauthorizedwhen not authenticated403 Forbiddenwhen creating channels for an organization you cannot write to409 Conflictwhen a duplicate website-level override already exists
Response
Returns the created notification channel object. See Error Codes for error responses.
Notification Channels
Manage how and where alerts are delivered. Channels can be organization-level (default for all customers), customer-level (override for a specific customer), or website-level (override for a specific monitor).
Delete Notification Channel
Deletes a notification channel. If the channel was an org-level default, organization defaults are automatically synced.