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 โ
| Field | Description | Default | Required |
|---|---|---|---|
| Webhook URL | Slack Incoming Webhook URL | โ | โ |
| Channel | Override channel (e.g., #backups) | Webhook default | โ |
| Username | Bot display name | DBackup | โ |
| Icon Emoji | Bot icon emoji (e.g., :shield:) | Default | โ |
Setup Guide โ
1. Create a Slack App with Incoming Webhook โ
- Go to api.slack.com/apps and click Create New App
- Choose From scratch, enter a name (e.g., "DBackup"), and select your workspace
- In the left sidebar, click Incoming Webhooks
- Toggle Activate Incoming Webhooks to On
- Click Add New Webhook to Workspace
- Select the channel where notifications should be sent
- Click Allow
- 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 โ
- Go to Notifications in the sidebar
- Click Add Notification
- Select Slack Webhook
- Paste the webhook URL
- (Optional) Set channel override, username, and icon emoji
- Click Test to verify
- 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:
| Color | Meaning |
|---|---|
๐ข 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-alertsto route to a specific channel - Set to
@usernameto 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:
| Value | Result |
|---|---|
:shield: | ๐ก๏ธ Shield icon |
:floppy_disk: | ๐พ Floppy disk |
:white_check_mark: | โ Checkmark |
:rotating_light: | ๐จ Alarm light |
Troubleshooting โ
Invalid Webhook URL โ
Slack returned 403: invalid_tokenSolutions:
- Verify the webhook URL is complete
- Check the Slack app hasn't been uninstalled
- Regenerate the webhook in Slack App settings
Channel Not Found โ
Slack returned 404: channel_not_foundSolutions:
- Ensure the channel exists and is not archived
- If using channel override, verify the channel name includes
# - Invite the bot to private channels
App Not Installed โ
Slack returned 403: team_disabledSolution: Reinstall the Slack app in your workspace settings.
Best Practices โ
- Create a dedicated Slack app โ Name it "DBackup" for easy identification
- Use a dedicated channel โ e.g.,
#db-backupsor#infra-alerts - Set a recognizable icon โ Use
:shield:or:floppy_disk:for quick visual identification - Don't share webhook URLs โ Treat them as secrets
- Use channel override sparingly โ Prefer creating separate webhooks per channel