Slack
Send interactive incident notifications to Slack with acknowledge and resolve actions
Slack Integration
The Slack integration brings incident management directly into your team's workspace. Receive rich notifications, acknowledge incidents without leaving Slack, and keep everyone informed with real-time updates.
Endpoint
Slack uses OAuth and interactive endpoints rather than a single webhook. Primary endpoints:
GET /api/settings/slack-oauth/callbackPOST /api/slack/actionsPOST /api/slack/commands
Why Use Slack Integration
| Without Slack | With Slack |
|---|---|
| Check OpsKnight separately | Incidents come to you |
| Context switch to acknowledge | One-click acknowledge in Slack |
| Manual status updates | Automatic thread updates |
| Siloed incident info | Team visibility |
Features
Incident Notifications
- Rich message format with incident details
- Urgency indicators (color-coded)
- Service information and affected components
- Timestamps and duration tracking
Interactive Actions
| Action | Description |
|---|---|
| Acknowledge | Mark incident as acknowledged directly from Slack |
| Resolve | Resolve incident without leaving Slack |
| View | Open incident in OpsKnight |
| Snooze | Temporarily silence the incident |
Real-Time Updates
- Thread updates when incident status changes
- Escalation notifications in the same thread
- Resolution summary when incident closes
Channel Routing
- Default channel for all incidents
- Per-service channels for focused alerting
- Per-urgency routing (critical to one channel, low to another)
Prerequisites
Before setting up Slack integration:
- OpsKnight admin access
- Slack workspace admin access (or app installation permission)
- OpsKnight accessible via HTTPS (required for Slack interactivity)
Setup Overview
1. Create Slack App
↓
2. Configure OAuth Scopes
↓
3. Set Up Interactivity
↓
4. Install to Workspace
↓
5. Connect in OpsKnight
↓
6. Configure Channels
Step 1: Create Slack App
Via Slack App Directory
- Go to api.slack.com/apps
- Click Create New App
- Choose From scratch
- Configure app details:
- App Name:
OpsKnight(or your preferred name) - Workspace: Select your workspace
- App Name:
- Click Create App
App Credentials
After creation, note these values (found in Basic Information):
- Client ID
- Client Secret
- Signing Secret
Step 2: Configure OAuth Scopes
The Slack app needs specific permissions to function.
Navigate to OAuth & Permissions
- In your Slack app settings
- Click OAuth & Permissions in the sidebar
Add Bot Token Scopes
Add these scopes under Bot Token Scopes:
| Scope | Purpose |
|---|---|
chat:write |
Send messages to channels |
chat:write.public |
Send to channels without joining |
channels:read |
List public channels |
groups:read |
List private channels |
users:read |
Get user information |
users:read.email |
Match users by email |
Add Redirect URL
Under Redirect URLs, add:
https://YOUR_OPSKNIGHT_URL/api/settings/slack-oauth/callback
Replace YOUR_OPSKNIGHT_URL with your OpsKnight instance URL.
Step 3: Set Up Interactivity
Enable interactive features for action buttons.
Enable Interactivity
- Go to Interactivity & Shortcuts in sidebar
- Toggle Interactivity to On
- Set Request URL:
https://YOUR_OPSKNIGHT_URL/api/slack/actions
Configure Shortcuts (Optional)
Add a global shortcut to create incidents:
- Click Create New Shortcut
- Choose Global
- Configure:
- Name: Create Incident
- Short Description: Create an OpsKnight incident
- Callback ID:
create_incident
Step 4: Install to Workspace
Install App
- Go to OAuth & Permissions
- Click Install to Workspace
- Review permissions
- Click Allow
Save Bot Token
After installation, copy the Bot User OAuth Token (starts with xoxb-).
Step 5: Connect in OpsKnight
Configure Slack Settings
- Go to Settings → Integrations → Slack
- Click Configure or Connect
- Enter credentials:
| Field | Value |
|---|---|
| Client ID | From Slack app |
| Client Secret | From Slack app |
| Signing Secret | From Slack app |
| Bot Token | xoxb-... token |
- Click Save
Test Connection
- Click Test Connection
- Verify "Connection successful" message
- Select a test channel
- Send a test message
Step 6: Configure Channels
Default Channel
Set a default channel for all incident notifications:
- Go to Settings → Integrations → Slack
- Select Default Channel from dropdown
- Save
Per-Service Channels
Route specific services to dedicated channels:
- Go to Services
- Open a service
- Click Edit or Settings
- Set Slack Channel (e.g.,
#payment-alerts) - Save
Channel Precedence:
Service-specific channel (if set)
↓
Default channel (fallback)
Private Channels
To use private channels:
- Invite the OpsKnight bot to the channel:
/invite @OpsKnight - The channel will appear in the dropdown
Notification Configuration
Event Types
Control which events trigger Slack notifications:
| Event | Default | Description |
|---|---|---|
| Incident Triggered | ✅ | New incident created |
| Incident Acknowledged | ✅ | Someone acknowledged |
| Incident Resolved | ✅ | Incident resolved |
| Incident Escalated | ✅ | Escalated to next step |
| SLA Breached | ✅ | SLA target missed |
| Note Added | ❌ | Comment added to incident |
Configuring Events
- Go to Settings → Integrations → Slack
- Scroll to Notification Events
- Toggle events on/off
- Save
Urgency Filtering
Only notify for certain urgency levels:
| Setting | Effect |
|---|---|
| All | Notify for HIGH, MEDIUM, LOW |
| High Only | Only HIGH urgency incidents |
| High + Medium | Exclude LOW urgency |
Message Format
Incident Notification
┌─────────────────────────────────────────────────┐
│ 🔴 HIGH URGENCY │
├─────────────────────────────────────────────────┤
│ Database Connection Timeout │
│ │
│ Service: Payment API │
│ Triggered: 2 minutes ago │
│ Status: Open │
│ │
│ [Acknowledge] [Resolve] [View in OpsKnight] │
└─────────────────────────────────────────────────┘
Message Elements
| Element | Description |
|---|---|
| Color bar | Red (HIGH), Yellow (MEDIUM), Blue (LOW) |
| Title | Incident title/summary |
| Service | Affected service name |
| Triggered | Time since incident started |
| Status | Current incident status |
| Actions | Interactive buttons |
Thread Updates
Status changes appear as thread replies:
Main message: Database Connection Timeout
└─ Thread: ✅ Acknowledged by @jane (2 min ago)
└─ Thread: 🔧 Resolved by @bob (15 min ago)
Resolution: Restarted connection pool
Interactive Actions
Acknowledge Button
When clicked:
- Incident status changes to ACKNOWLEDGED
- Escalation stops
- Thread update posted
- Button changes to "Acknowledged ✓"
Resolve Button
When clicked:
- Modal appears for resolution note (optional)
- Incident status changes to RESOLVED
- Thread update with resolution summary
- Buttons removed (incident closed)
View Button
Opens the incident detail page in OpsKnight.
Snooze Options
Snooze menu options:
- 15 minutes
- 30 minutes
- 1 hour
- 4 hours
- Custom duration
User Mapping
OpsKnight maps Slack users to OpsKnight users for attribution.
Automatic Mapping
When a Slack user takes an action:
- OpsKnight looks up user by email
- If found, action attributed to that user
- If not found, action shows "via Slack"
Ensuring Mapping Works
- Users must have same email in Slack and OpsKnight
- Slack profile email must be visible to apps
- OpsKnight user must be ACTIVE
Slash Commands (Optional)
Add slash commands for quick actions.
Available Commands
| Command | Description |
|---|---|
/opsknight incidents |
List open incidents |
/opsknight oncall |
Who's on-call now |
/opsknight status |
System status summary |
/opsknight create |
Create manual incident |
Setting Up Slash Commands
- Go to Slack app settings
- Click Slash Commands
- Click Create New Command
- Configure:
- Command:
/opsknight - Request URL:
https://YOUR_OPSKNIGHT_URL/api/integrations/slack/commands - Description: OpsKnight incident management
- Command:
- Save
Multiple Workspaces
Connect OpsKnight to multiple Slack workspaces.
Adding Another Workspace
- Go to Settings → Integrations → Slack
- Click Add Workspace
- Complete OAuth flow for new workspace
- Configure channels for new workspace
Workspace-Specific Settings
Each workspace can have:
- Different default channel
- Different notification preferences
- Different user mappings
Troubleshooting
Messages Not Sending
- Verify bot token is correct
- Check channel exists and bot has access
- Verify bot is in channel (for private channels)
- Test connection in settings
- Check OpsKnight logs for errors
Action Buttons Not Working
- Verify interactivity URL is correct
- Check HTTPS — Slack requires HTTPS
- Verify signing secret is correct
- Check OpsKnight is accessible from internet
Wrong User Attribution
- Check email match between Slack and OpsKnight
- Verify Slack email is visible to apps
- Check user is ACTIVE in OpsKnight
Channel Not Appearing
- Public channels appear automatically
- Private channels need bot invited first
- Refresh channel list in settings
Rate Limiting
If you see rate limit errors:
- OpsKnight batches notifications automatically
- Reduce notification frequency if needed
- Check for notification loops
Best Practices
Channel Organization
| Channel | Purpose |
|---|---|
#incidents-critical |
HIGH urgency only |
#incidents-all |
All incidents |
#payment-oncall |
Payment team incidents |
#platform-alerts |
Platform team incidents |
Reducing Noise
- Use per-service channels to segment alerts
- Filter by urgency in low-priority channels
- Disable "note added" notifications unless needed
- Use threads — updates don't spam channel
Response Workflow
- Incident posted to channel
- On-call sees notification
- Clicks Acknowledge in Slack
- Investigates the issue
- Clicks Resolve when fixed
- Adds resolution note in modal
Integration with Slack Workflows
Combine with Slack Workflow Builder:
- Auto-create incident channel for major incidents
- Notify stakeholders on HIGH urgency
- Post to status channel on resolution
Security Considerations
Signing Secret Verification
OpsKnight verifies all requests from Slack using the signing secret:
- Prevents spoofed requests
- Validates request timestamp
- Required for production
Token Security
- Never share tokens in public channels
- Rotate tokens if compromised
- Use environment variables for tokens
Channel Access
- Bot only accesses channels it's invited to
- Users can only see incidents they have access to
- Actions are attributed to authenticated users
API Reference
Webhook Endpoint
POST /api/slack/actions
Handles all button clicks and modal submissions.
Command Endpoint
POST /api/slack/commands
Handles slash command invocations.
OAuth Callback
GET /api/settings/slack-oauth/callback
Handles OAuth flow completion.
Related Topics
- Slack OAuth Setup — Detailed OAuth configuration
- Notifications — All notification channels
- Integrations Overview — Other integrations
- Services — Per-service channel configuration
Last updated for v1
Edit this page on GitHub