Skip to main content

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

  1. Navigate to your project's Sources page
  2. Click Connect Slack
  3. Authorize the Dispatch Slack app for your workspace
  4. 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:

EventDescription
messageMessage posted in a channel
reaction_added / reaction_removedEmoji reaction changes
channel_created / channel_archive / channel_unarchiveChannel lifecycle
member_joined_channel / member_left_channelChannel membership changes
pin_added / pin_removedPinned message changes
file_shared / file_createdFile uploads
emoji_changedCustom emoji additions/removals
team_joinNew member joined workspace
app_mentionBot mentioned in a channel

Slack as a Destination

Connecting

  1. Navigate to your project's Destinations page
  2. Click Connect Slack
  3. Authorize the Dispatch Slack app
  4. 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:

  1. Go to Sources or Destinations and find the Slack connection
  2. Click Disconnect
  3. This revokes the OAuth token and deactivates the endpoint/destination