Skip to main content

Notification Channels API

Create, manage, and test notification channels for alert delivery.

List Channels

Returns all notification channels for the project.
GET /api/v1/channels
Query Parameters
ParameterTypeDescription
channel_typestringFilter by type: slack, pagerduty, email, webhook, discord, teams, opsgenie
enabledbooleanFilter 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

GET /api/v1/channels/:id
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

POST /api/v1/channels
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
{
  "name": "Team Email",
  "channel_type": "email",
  "config": {
    "recipients": ["[email protected]", "[email protected]"]
  }
}
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"
}