Skip to content

Notification Channels

Notification channels let you receive real-time alerts when webhook deliveries fail, routes recover, or circuit breakers trip. Send notifications to Slack, Microsoft Teams, Discord, PagerDuty, email, or custom webhooks.

Channel Types

TypeDescriptionBest For
SlackSend Block Kit messages to Slack channelsTeam alerts
Microsoft TeamsSend Adaptive Cards to Teams channelsEnterprise team alerts
DiscordSend embedded messages to Discord channelsDeveloper/community alerts
PagerDutyCreate incidents via Events API v2On-call incident management
EmailSend emails to multiple recipientsOn-call notifications
WebhookPOST to custom HTTP endpointsIntegration with monitoring tools

Creating Channels

Slack Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ops Slack",
    "type": "slack",
    "config": {
      "webhookUrl": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
    }
  }'

To get a Slack webhook URL:

  1. Go to your Slack workspace settings
  2. Navigate to AppsIncoming Webhooks
  3. Create a new webhook and select a channel

Email Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "On-Call Team",
    "type": "email",
    "config": {
      "emails": ["[email protected]", "[email protected]"]
    }
  }'

Custom Webhook Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Monitoring Webhook",
    "type": "webhook",
    "config": {
      "url": "https://your-service.com/alerts",
      "method": "POST",
      "headers": {
        "Content-Type": "application/json",
        "Authorization": "Bearer whr_your_api_key"
      },
      "hmacSecret": "optional-signing-secret"
    }
  }'

Microsoft Teams Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "DevOps Team",
    "type": "teams",
    "config": {
      "webhookUrl": "https://outlook.office.com/webhook/..."
    }
  }'

To get a Microsoft Teams webhook URL:

  1. Open your Teams channel
  2. Click the ... menu → Connectors
  3. Find Incoming Webhook and click Configure
  4. Name the webhook and click Create
  5. Copy the webhook URL

Teams notifications use Adaptive Cards with color-coded status, structured data fields, and a link to your Hookbase dashboard.

PagerDuty Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "On-Call Paging",
    "type": "pagerduty",
    "config": {
      "routingKey": "your-32-character-integration-key",
      "severity": "error",
      "customService": "Hookbase Webhooks"
    }
  }'

Config options:

FieldRequiredDescription
routingKeyYes32-character integration key from PagerDuty
severityNoDefault severity: critical, error, warning, or info
customServiceNoCustom service name (defaults to "Hookbase")

To get a PagerDuty integration key:

  1. Go to Services → Select or create a service
  2. Click IntegrationsAdd Integration
  3. Select Events API v2
  4. Copy the Integration Key (32 characters)

PagerDuty Features

Automatic Incident Management:

  • Deduplication: Incidents are deduplicated by route/cron ID, preventing duplicate alerts
  • Auto-Resolve: When a route recovers, the incident is automatically resolved
  • Severity Mapping: Circuit breaker events use "critical" severity, failures use "error"
Hookbase EventPagerDuty ActionSeverity
Delivery FailureTriggererror (configurable)
Circuit OpenedTriggercritical
Cron FailureTriggererror (configurable)
RecoveryResolveinfo
Circuit ClosedResolveinfo

Discord Channel

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Dev Alerts",
    "type": "discord",
    "config": {
      "webhookUrl": "https://discord.com/api/webhooks/...",
      "username": "Hookbase Bot",
      "avatarUrl": "https://hookbase.app/logo.png"
    }
  }'

Config options:

FieldRequiredDescription
webhookUrlYesDiscord webhook URL
usernameNoBot display name (defaults to webhook name)
avatarUrlNoBot avatar image URL

To create a Discord webhook:

  1. Go to your Discord channel
  2. Click the gear icon → IntegrationsWebhooks
  3. Click New Webhook
  4. Name it and copy the Webhook URL

Discord notifications use embedded messages with color-coded status (red for failures, green for success), inline fields, and timestamps.

Rate Limiting

Discord webhooks have rate limits (~30 requests/minute). For high-volume alerting, consider using PagerDuty or a custom webhook with batching.

Linking Channels to Routes

Channels must be linked to specific routes to receive notifications:

bash
curl -X POST "https://api.hookbase.app/api/notification-channels/{channelId}/routes" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "routeId": "{routeId}",
    "notifyOnFailure": true,
    "notifyOnRecovery": true,
    "notifyOnCircuitOpen": true
  }'

Notification Triggers

TriggerDescription
notifyOnFailureWhen consecutive delivery failures exceed the threshold
notifyOnRecoveryWhen a failing route starts succeeding again
notifyOnCircuitOpenWhen the circuit breaker trips open

Managing Channels via Dashboard

  1. Navigate to SettingsNotifications
  2. Click Add Channel
  3. Select the channel type
  4. Configure the channel settings
  5. Click Create

Linking Routes in Dashboard

  1. Find your channel in the list
  2. Click the expand arrow to see linked routes
  3. Click Link Route
  4. Select a route and choose notification triggers
  5. Click Link Route

Testing Channels

Send a test notification to verify your configuration:

Via API

bash
curl -X POST "https://api.hookbase.app/api/notification-channels/{channelId}/test" \
  -H "Authorization: Bearer {token}"

Via Dashboard

  1. Navigate to SettingsNotifications
  2. Find the channel
  3. Click the Test button

Notification Payloads

Slack Message Format

json
{
  "text": "Webhook Alert",
  "attachments": [{
    "color": "#ff0000",
    "title": "Delivery Failures",
    "text": "Route 'GitHub → Slack' has failed 5 consecutive times",
    "fields": [
      { "title": "Route", "value": "GitHub → Slack", "short": true },
      { "title": "Destination", "value": "https://example.com/webhook", "short": true },
      { "title": "Last Error", "value": "Connection timeout", "short": false }
    ],
    "ts": 1705312200
  }]
}

Custom Webhook Payload

json
{
  "type": "delivery_failure",
  "route": {
    "id": "route_123",
    "name": "GitHub → Slack"
  },
  "destination": {
    "id": "dest_456",
    "url": "https://example.com/webhook"
  },
  "consecutiveFailures": 5,
  "lastError": "Connection timeout",
  "timestamp": "2024-01-15T10:30:00Z"
}

Email Format

Subject: [Hookbase] Delivery Failures: GitHub → Slack

Body includes route details, failure count, last error, and links to the dashboard.

Teams Adaptive Card Format

json
{
  "type": "message",
  "attachments": [{
    "contentType": "application/vnd.microsoft.card.adaptive",
    "content": {
      "type": "AdaptiveCard",
      "version": "1.4",
      "body": [
        {
          "type": "TextBlock",
          "text": "Route Delivery Failed",
          "size": "Large",
          "weight": "Bolder",
          "color": "attention"
        },
        {
          "type": "FactSet",
          "facts": [
            { "title": "Route", "value": "GitHub → Slack" },
            { "title": "Destination", "value": "slack-webhook" },
            { "title": "Consecutive Failures", "value": "5" }
          ]
        }
      ],
      "actions": [
        {
          "type": "Action.OpenUrl",
          "title": "View in Dashboard",
          "url": "https://app.hookbase.app/..."
        }
      ]
    }
  }]
}

PagerDuty Events API v2 Format

json
{
  "routing_key": "your-routing-key",
  "event_action": "trigger",
  "dedup_key": "hookbase-route-route_123",
  "payload": {
    "summary": "Route \"GitHub → Slack\" delivery failed: Connection timeout",
    "source": "slack-webhook",
    "severity": "error",
    "timestamp": "2024-01-15T10:30:00Z",
    "component": "Hookbase",
    "group": "webhook-delivery",
    "class": "route_failure",
    "custom_details": {
      "route": "GitHub → Slack",
      "source": "GitHub",
      "destination": "slack-webhook",
      "consecutive_failures": "5",
      "dashboard_url": "https://app.hookbase.app/..."
    }
  }
}

Discord Embed Format

json
{
  "embeds": [{
    "title": "Route Delivery Failed",
    "color": 15548997,
    "fields": [
      { "name": "Route", "value": "GitHub → Slack", "inline": true },
      { "name": "Source", "value": "GitHub", "inline": true },
      { "name": "Failures", "value": "5 consecutive", "inline": true }
    ],
    "url": "https://app.hookbase.app/...",
    "footer": { "text": "Hookbase" },
    "timestamp": "2024-01-15T10:30:00.000Z"
  }],
  "username": "Hookbase Bot"
}

HMAC Signing (Webhook Channels)

For webhook channels, you can configure HMAC signing for security:

bash
curl -X POST "https://api.hookbase.app/api/notification-channels" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Secure Webhook",
    "type": "webhook",
    "config": {
      "url": "https://your-service.com/alerts",
      "method": "POST",
      "hmacSecret": "your-secret-key"
    }
  }'

The signature is sent in the X-Hookbase-Signature header as a hex-encoded HMAC-SHA256.

Verify in your service:

javascript
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Best Practices

  1. Set up before issues occur: Don't wait for failures to configure notifications
  2. Use multiple channels: Send to both Slack and email for critical routes
  3. Configure recovery alerts: Know when issues are resolved, not just when they start
  4. Test regularly: Verify channels work before you need them
  5. Don't over-notify: Choose appropriate triggers to avoid alert fatigue

Managing Linked Routes

View linked routes

bash
curl -X GET "https://api.hookbase.app/api/notification-channels/{channelId}/routes" \
  -H "Authorization: Bearer {token}"
bash
curl -X PATCH "https://api.hookbase.app/api/notification-channels/{channelId}/routes/{routeId}" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "notifyOnFailure": true,
    "notifyOnRecovery": false,
    "notifyOnCircuitOpen": true
  }'
bash
curl -X DELETE "https://api.hookbase.app/api/notification-channels/{channelId}/routes/{routeId}" \
  -H "Authorization: Bearer {token}"

Released under the MIT License.