v2026.1 Open Portal ↗
On this page

Slack Integration

Prerequisites

To set up the Slack integration you need a Slack workspace where you have admin or App Manager permissions, and a StackFlow account with super_admin or itsm_manager role.

RequirementDetails
Slack workspaceWorkspace admin or App Manager role
StackFlow rolesuper_admin or itsm_manager
ChannelDedicated #incidents channel (recommended)

Step 1: Create a Slack App

  1. Go to https://api.slack.com/apps and click Create New App
  2. Select From scratch, name it StackFlow, and select your workspace
  3. Under Basic Information, note the App ID and Signing Secret
  4. Upload the StackFlow logo as the app icon (optional but recommended)

Step 2: Configure OAuth Scopes

  1. In the Slack App settings, navigate to OAuth & Permissions
  2. Under Bot Token Scopes, add the following scopes:
ScopePurpose
channels:readList channels to select notification targets
chat:writePost incident notifications to channels
chat:write.publicPost to channels the bot hasn't joined
commandsHandle slash commands (/incident, /stackflow)
im:writeSend direct messages for approval requests
users:readResolve Slack user to StackFlow account
users:read.emailMatch Slack users to StackFlow users by email
  1. Click Install App to Workspace and authorize
  2. Copy the Bot User OAuth Token (starts with xoxb-)

Step 3: Set Up Incoming Webhook

  1. Navigate to Incoming Webhooks in the Slack app settings
  2. Enable Activate Incoming Webhooks
  3. Click Add New Webhook to Workspace and select your #incidents channel
  4. Copy the webhook URL (format: https://hooks.slack.com/services/T.../B.../...)
Multiple Channels: You can create multiple Incoming Webhooks for different channels. In StackFlow, map each P1-P4 priority to a different Slack channel (e.g., #incidents-critical for P1, #incidents-high for P2).

Step 4: Configure Slash Commands

  1. In the Slack App, go to Slash CommandsCreate New Command
  2. Create the /incident command with Request URL: https://your-instance.stackflow-tech.com/prod/api/webhooks/slack/commands
  3. Create the /stackflow command with the same Request URL
  4. Enable Escape channels, users, and links for both commands

Step 5: Connect in StackFlow

  1. Navigate to Admin → Integration Hub → Slack → Configure
  2. Paste the Bot User OAuth Token (xoxb-...) into the Bot Token field
  3. Paste the Incoming Webhook URL for each priority channel
  4. Paste the Signing Secret for slash command verification
  5. Click Save & Test Connection
# StackFlow stores the bot token in Secrets Manager:
aws secretsmanager get-secret-value   --secret-id stackflow/integrations/slack/bot-token   --region us-east-1

Incident Alert Templates

StackFlow posts Slack Block Kit messages for incident notifications. Customize templates in Admin → Integration Hub → Slack → Templates:

{
  "blocks": [
    {
      "type": "header",
      "text": {"type": "plain_text", "text": "🚨 {{incident.priority}} Incident: {{incident.short_description}}"}
    },
    {
      "type": "section",
      "fields": [
        {"type": "mrkdwn", "text": "*ID:*
{{incident.id}}"},
        {"type": "mrkdwn", "text": "*State:*
{{incident.state}}"},
        {"type": "mrkdwn", "text": "*Assigned To:*
{{incident.assigned_to}}"},
        {"type": "mrkdwn", "text": "*SLA Breach:*
{{incident.sla_breach_at}}"}
      ]
    },
    {
      "type": "actions",
      "elements": [
        {"type": "button", "text": {"type": "plain_text", "text": "View Incident"}, "url": "{{incident.url}}"},
        {"type": "button", "text": {"type": "plain_text", "text": "Acknowledge"}, "action_id": "acknowledge_incident", "value": "{{incident.id}}"}
      ]
    }
  ]
}

Field Reference

FieldRequiredDescription
Bot TokenYesSlack bot OAuth token starting with xoxb-
Signing SecretYesVerify slash command and interaction payloads
P1 Channel WebhookYesIncoming webhook URL for P1 alerts
P2 Channel WebhookNoIncoming webhook URL for P2 alerts (defaults to P1 channel)
P3/P4 Channel WebhookNoOptional lower-priority channels
DM on AssignmentNoSend DM to assignee when incident is assigned (default: true)
Resolve NotificationNoPost to channel when incident resolved (default: true)

Testing the Integration

  1. In StackFlow, go to Admin → Integration Hub → Slack → Test
  2. Click Send Test Message — a test notification will appear in your configured channel
  3. From Slack, type /incident create test incident — StackFlow should create a test incident and reply with the incident ID
  4. Create a real P1 incident via the API and verify the Slack notification appears within 10 seconds
# Manually trigger a test webhook
curl -X POST   https://your-instance.stackflow-tech.com/prod/api/integrations/slack/test   -H "Authorization: Bearer $TOKEN"   -H "Content-Type: application/json"   -d '{"channel": "#incidents", "message": "StackFlow Slack integration test"}'

Troubleshooting

IssueCauseFix
Bot not posting to channelBot not invited to channelIn Slack, type /invite @StackFlow in the channel
Slash command returns 403Signing secret mismatchRe-copy signing secret from Slack App → Basic Information
Slash command times outLambda cold start > 3sSlash commands require a 3s response. Lambda is warmed every 4 min; retry during off-peak.
User not found in StackFlowEmail mismatch between Slack and CognitoEnsure Slack profile email matches StackFlow account email
Token expiredBot token revokedRe-install the Slack App and update the token in Integration Hub