Slack Integration
Dispatch integrates with Slack as both a source (receive Slack events) and a destination (post messages to Slack channels).
Slack as a Source
Connecting
- Navigate to your project's Sources page
- Click Connect Slack
- Authorize the Dispatch Slack app for your workspace
- Select a channel to receive events from
Dispatch will:
- Create a webhook endpoint with
provider = "slack" - Subscribe to events from the selected channel
Slack URL Verification
When Slack sends a URL verification challenge, Dispatch handles it automatically:
// Slack sends:
{
"type": "url_verification",
"challenge": "abc123"
}
// Dispatch responds:
{
"challenge": "abc123"
}
No event is created for verification requests.
Signature Verification
Slack webhooks use the X-Slack-Signature header with the format:
v0=HMAC-SHA256(signing_secret, "v0:{timestamp}:{body}")
The X-Slack-Request-Timestamp header must be within 5 minutes of the current time. Dispatch verifies this automatically.
Supported Slack Events
Dispatch auto-formats the following Slack event types:
| Event | Description |
|---|---|
message | Message posted in a channel |
reaction_added / reaction_removed | Emoji reaction changes |
channel_created / channel_archive / channel_unarchive | Channel lifecycle |
member_joined_channel / member_left_channel | Channel membership changes |
pin_added / pin_removed | Pinned message changes |
file_shared / file_created | File uploads |
emoji_changed | Custom emoji additions/removals |
team_join | New member joined workspace |
app_mention | Bot mentioned in a channel |
Slack as a Destination
Connecting
- Navigate to your project's Destinations page
- Click Connect Slack
- Authorize the Dispatch Slack app
- Select a channel to post messages to
Dispatch will:
- Create a destination with
type = "slack" - Store the bot token (encrypted at rest)
- Use the Slack API to post messages to the selected channel
Message Format
When delivering to Slack, Dispatch formats messages as Slack attachments:
{
"text": "New event received",
"username": "Dispatch",
"attachments": [
{
"color": "#e67e22",
"title": "push",
"text": "3 commits pushed to main",
"fields": [
{
"title": "Repository",
"value": "owner/repo",
"short": true
}
],
"footer": "Dispatch",
"ts": 1710432000
}
]
}
Disconnecting
To disconnect Slack:
- Go to Sources or Destinations and find the Slack connection
- Click Disconnect
- This revokes the OAuth token and deactivates the endpoint/destination