Notification Channels API
Notification channels define where alerts are sent when route failures, recoveries, or other events occur.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/notification-channels | List channels |
| POST | /api/notification-channels | Create channel |
| GET | /api/notification-channels/{id} | Get channel |
| PATCH | /api/notification-channels/{id} | Update channel |
| DELETE | /api/notification-channels/{id} | Delete channel |
| POST | /api/notification-channels/{id}/test | Send test notification |
Notification Channel Object
json
{
"id": "nch_abc123",
"name": "Slack #alerts",
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx"
},
"enabled": true,
"lastNotifiedAt": "2024-01-15T10:30:00Z",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}Channel Types
Slack
json
{
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx"
}
}Microsoft Teams
json
{
"type": "teams",
"config": {
"webhookUrl": "https://outlook.office.com/webhook/..."
}
}Discord
json
{
"type": "discord",
"config": {
"webhookUrl": "https://discord.com/api/webhooks/..."
}
}PagerDuty
json
{
"type": "pagerduty",
"config": {
"routingKey": "your-pagerduty-routing-key",
"severity": "critical"
}
}PagerDuty severity options: critical, error, warning, info
Email
json
{
"type": "email",
"config": {
"addresses": ["[email protected]", "[email protected]"]
}
}Webhook
json
{
"type": "webhook",
"config": {
"url": "https://yourapp.com/hookbase-alerts",
"headers": {
"Authorization": "Bearer your-secret"
}
}
}List Channels
http
GET /api/notification-channelsExample
bash
curl https://api.hookbase.app/api/notification-channels \
-H "Authorization: Bearer whr_your_api_key"Response
json
{
"data": [
{
"id": "nch_abc123",
"name": "Slack #alerts",
"type": "slack",
"enabled": true,
"lastNotifiedAt": "2024-01-15T10:30:00Z"
}
]
}Create Channel
http
POST /api/notification-channelsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Display name |
| type | string | Yes | Channel type: slack, teams, discord, pagerduty, email, webhook |
| config | object | Yes | Type-specific configuration |
| enabled | boolean | No | Active status (default: true) |
Example
bash
curl -X POST https://api.hookbase.app/api/notification-channels \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Slack #alerts",
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx"
}
}'Response
json
{
"id": "nch_new123",
"name": "Slack #alerts",
"type": "slack",
"config": {
"webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx"
},
"enabled": true,
"createdAt": "2024-01-15T10:30:00Z"
}Get Channel
http
GET /api/notification-channels/{id}Returns the full channel object.
Update Channel
http
PATCH /api/notification-channels/{id}Request Body
| Field | Type | Description |
|---|---|---|
| name | string | Display name |
| config | object | Type-specific configuration |
| enabled | boolean | Active status |
Delete Channel
http
DELETE /api/notification-channels/{id}Response
204 No ContentTest Channel
Send a test notification to verify the channel is configured correctly.
http
POST /api/notification-channels/{id}/testExample
bash
curl -X POST https://api.hookbase.app/api/notification-channels/nch_abc123/test \
-H "Authorization: Bearer whr_your_api_key"Response
json
{
"success": true,
"message": "Test notification sent to Slack #alerts"
}Error Response
json
{
"success": false,
"error": "Failed to send notification: 403 Forbidden",
"message": "Check that the webhook URL is correct and the integration is still active"
}Error Responses
400 Bad Request
Invalid channel config:
json
{
"error": "Bad Request",
"message": "Slack webhook URL must start with https://hooks.slack.com/",
"code": "INVALID_CONFIG"
}Related
- Notification Channels Guide — Setup and usage patterns
- Routes API — Configure route notifications