Notification Channels API
Create, manage, and test notification channels for alert delivery.
List Channels
Returns all notification channels for the project.
Query Parameters
| Parameter | Type | Description |
|---|
channel_type | string | Filter by type: slack, pagerduty, email, webhook, discord, teams, opsgenie |
enabled | boolean | Filter by enabled status |
Response
{
"data": [
{
"id": "chan_1234567890",
"name": "Engineering Slack",
"channel_type": "slack",
"enabled": true,
"verified": true,
"success_count": 156,
"failure_count": 2,
"last_used_at": "2024-01-15T10:30:00Z",
"created_at": "2024-01-01T00:00:00Z"
}
]
}
Get Channel
Response
{
"data": {
"id": "chan_1234567890",
"name": "Engineering Slack",
"channel_type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/services/..."
},
"enabled": true,
"verified": true,
"success_count": 156,
"failure_count": 2,
"last_used_at": "2024-01-15T10:30:00Z",
"last_tested_at": "2024-01-14T09:00:00Z",
"created_at": "2024-01-01T00:00:00Z"
}
}
Create Channel
Slack Channel
{
"name": "Engineering Slack",
"channel_type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX"
}
}
PagerDuty Channel
{
"name": "On-Call PagerDuty",
"channel_type": "pagerduty",
"config": {
"routing_key": "your-pagerduty-routing-key"
}
}
Email Channel
Webhook Channel
{
"name": "Custom Webhook",
"channel_type": "webhook",
"config": {
"webhook_url": "https://api.example.com/alerts",
"headers": {
"Authorization": "Bearer token"
}
}
}
Update Channel
PATCH /api/v1/channels/:id
Request
{
"name": "Updated Channel Name",
"enabled": true,
"config": {
"webhook_url": "https://new-webhook-url.com"
}
}
Delete Channel
DELETE /api/v1/channels/:id
Deleting a channel will remove it from all alert rules that use it.
Test Channel
Send a test notification to verify the channel is configured correctly.
POST /api/v1/channels/:id/test
Response
{
"success": true,
"message": "Test notification sent successfully"
}
Error Response
{
"success": false,
"error": "Failed to send: 401 Unauthorized"
}