Skip to content

Slack โ€‹

Send formatted notifications to Slack channels using Incoming Webhooks. Slack notifications use the Block Kit framework for rich, structured messages.

Overview โ€‹

  • ๐Ÿ’ฌ Block Kit Formatting โ€” Headers, sections, and structured field layouts
  • ๐ŸŽจ Color-Coded Attachments โ€” Visual status indicators via colored sidebars
  • ๐Ÿ“Œ Channel Override โ€” Optionally route messages to a different channel
  • ๐Ÿค– Custom Bot Identity โ€” Set display name and icon emoji

Configuration โ€‹

FieldDescriptionDefaultRequired
Webhook URLSlack Incoming Webhook URLโ€”โœ…
ChannelOverride channel (e.g., #backups)Webhook defaultโŒ
UsernameBot display nameDBackupโŒ
Icon EmojiBot icon emoji (e.g., :shield:)DefaultโŒ

Setup Guide โ€‹

1. Create a Slack App with Incoming Webhook โ€‹

  1. Go to api.slack.com/apps and click Create New App
  2. Choose From scratch, enter a name (e.g., "DBackup"), and select your workspace
  3. In the left sidebar, click Incoming Webhooks
  4. Toggle Activate Incoming Webhooks to On
  5. Click Add New Webhook to Workspace
  6. Select the channel where notifications should be sent
  7. Click Allow
  8. Copy the Webhook URL (starts with https://hooks.slack.com/services/...)

TIP

You can add multiple webhooks for different channels within the same Slack app.

2. Configure in DBackup โ€‹

  1. Go to Notifications in the sidebar
  2. Click Add Notification
  3. Select Slack Webhook
  4. Paste the webhook URL
  5. (Optional) Set channel override, username, and icon emoji
  6. Click Test to verify
  7. Save

3. Test the Connection โ€‹

Click Test to send a test notification. You should see a message appear in your Slack channel.

Message Format โ€‹

Slack notifications use Block Kit with color-coded attachments:

ColorMeaning
๐ŸŸข Green (#00ff00)Success
๐Ÿ”ด Red (#ff0000)Failure
๐Ÿ”ต Blue (#3b82f6)Informational

Each message includes:

  • Header Block โ€” Event title
  • Section Block โ€” Summary message text
  • Fields Block โ€” Structured key-value data (job name, duration, size, etc.)
  • Context Block โ€” Timestamp

Channel Override โ€‹

The Channel field lets you override the default channel configured in the webhook. This is useful when you want to use a single webhook to send to different channels:

  • Leave empty to use the webhook's default channel
  • Set to #production-alerts to route to a specific channel
  • Set to @username to DM a specific user

WARNING

Channel override requires the Slack app to have the chat:write scope. The basic Incoming Webhook scope only sends to the configured channel.

Icon Emoji โ€‹

Set a custom emoji as the bot's avatar:

ValueResult
:shield:๐Ÿ›ก๏ธ Shield icon
:floppy_disk:๐Ÿ’พ Floppy disk
:white_check_mark:โœ… Checkmark
:rotating_light:๐Ÿšจ Alarm light

Troubleshooting โ€‹

Invalid Webhook URL โ€‹

Slack returned 403: invalid_token

Solutions:

  1. Verify the webhook URL is complete
  2. Check the Slack app hasn't been uninstalled
  3. Regenerate the webhook in Slack App settings

Channel Not Found โ€‹

Slack returned 404: channel_not_found

Solutions:

  1. Ensure the channel exists and is not archived
  2. If using channel override, verify the channel name includes #
  3. Invite the bot to private channels

App Not Installed โ€‹

Slack returned 403: team_disabled

Solution: Reinstall the Slack app in your workspace settings.

Best Practices โ€‹

  1. Create a dedicated Slack app โ€” Name it "DBackup" for easy identification
  2. Use a dedicated channel โ€” e.g., #db-backups or #infra-alerts
  3. Set a recognizable icon โ€” Use :shield: or :floppy_disk: for quick visual identification
  4. Don't share webhook URLs โ€” Treat them as secrets
  5. Use channel override sparingly โ€” Prefer creating separate webhooks per channel

Released under the GNU General Public License. | Privacy ยท Legal Notice