Slack Integration
Slack integration is available on the Pro and Enterprise plans. View plans or upgrade now.
The NightOps Slack bot lets your team start and stop collections directly from Slack, receive notifications, and check infrastructure status.
Features
- Start/Stop Collections — Turn resources on/off from any Slack channel
- Status Checks — See what's running without leaving Slack
- Notifications — Get alerts when schedules run or failures occur
- Approvals — Require approval before starting production resources
- On-Call Integration — Automatically notify on-call when resources need attention
Installation
Step 1: Connect to Slack
- Go to Settings → Integrations in NightOps
- Click Add to Slack
- Select your Slack workspace
- Authorize NightOps to:
- Send messages to channels
- Read messages (for commands)
- Access user profiles (for permissions)
- Click Allow
Step 2: Invite Bot to Channel
Invite the NightOps bot to channels where you want to use it:
/invite @NightOps
Or from channel settings: Integrations → Add Apps → NightOps
Step 3: Verify Installation
Test the bot is working:
/nightops status
You should see a status summary of your collections.
Commands
Basic Commands
| Command | Description |
|---|---|
/nightops help | Show available commands |
/nightops status | Show status of all collections |
/nightops list | List all collections |
Collection Control
| Command | Description |
|---|---|
/nightops start <collection> | Start a collection |
/nightops stop <collection> | Stop a collection |
/nightops status <collection> | Show detailed collection status |
Examples
/nightops start staging-api
→ Starting "Staging API" (5 resources)...
→ ✓ Staging API is now running
/nightops stop dev-environment
→ Stopping "Dev Environment" (8 resources)...
→ ✓ Dev Environment is now stopped
/nightops status staging-api
→ Staging API: Running
→ api-server-1 Running m5.large $119.81/mo
→ api-server-2 Running m5.large $119.81/mo
→ worker-1 Running t3.medium $30.37/mo
→ rds-primary Running db.t3.medium $50.00/mo
Interactive Messages
Collection Cards
When you run /nightops status, you get interactive cards:
┌─────────────────────────────────────────┐
│ 🟢 Staging API │
│ 5 resources • $350.36/month │
│ │
│ [Start] [Stop] [View Details] │
└─────────────────────────────────────────┘
Click buttons to take action without typing commands.
Confirmation Dialogs
For stop operations, a confirmation dialog appears:
┌─────────────────────────────────────────┐
│ Stop Staging API? │
│ │
│ This will stop 5 resources: │
│ • api-server-1 │
│ • api-server-2 │
│ • worker-1 │
│ • rds-primary │
│ • cache-cluster │
│ │
│ [Cancel] [Stop Collection] │
└─────────────────────────────────────────┘
Notifications
Configure Notifications
- Go to Settings → Integrations → Slack
- Under Notifications, configure:
| Notification | Description | Default |
|---|---|---|
| Schedule started | When a schedule starts resources | Channel |
| Schedule stopped | When a schedule stops resources | Channel |
| Action failed | When a start/stop operation fails | Channel + DM |
| Manual override | When someone manually starts/stops | Channel |
Channel Notifications
Set a default channel for notifications:
- Go to Settings → Integrations → Slack
- Under Default Channel, select the channel
- Save
Per-Collection Channels
Send notifications to different channels per collection:
- Edit the collection
- Under Slack Channel, select the channel
- Save
Example:
Staging API → #staging-ops
QA Environment → #qa-team
Production → #production-alerts
Approval Workflows
Require approval before starting specific collections:
Configure Approvals
- Go to Settings → Integrations → Slack → Approvals
- Add an approval rule:
Collection: production-*
Require approval from: #infrastructure-approvers
Timeout: 30 minutes - Save
Approval Flow
When someone tries to start a protected collection:
Alice: /nightops start production-api
NightOps:
┌─────────────────────────────────────────┐
│ 🔔 Approval Required │
│ │
│ Alice wants to start Production API │
│ Reason: "Debugging customer issue" │
│ │
│ [Approve] [Deny] │
│ │
│ Expires in 30 minutes │
└─────────────────────────────────────────┘
Bob (approver): [Approve]
NightOps: ✓ Approved by Bob. Starting Production API...
User Linking
Link Slack users to NightOps accounts for permissions:
Automatic Linking
If using SSO with the same email domain, users are linked automatically.
Manual Linking
- User runs
/nightops linkin Slack - User clicks the link to authenticate
- Accounts are connected
Check Linked Status
/nightops whoami
→ Linked as: alice@company.com
→ Role: Member
→ Collections: staging-*, qa-*
Channel Permissions
Control which channels can run which commands:
Configure Channel Permissions
- Go to Settings → Integrations → Slack → Channels
- Add channel rules:
| Channel | Allowed Commands | Collections |
|---|---|---|
| #dev-team | All | dev-, staging- |
| #qa-team | start, stop | qa-* |
| #all-hands | status only | * |
| #production-ops | All + approvals | production-* |
Default Permissions
Channels not explicitly configured:
- Can run
status,list,help - Cannot run
startorstop
Slash Command Reference
/nightops
Main command prefix. All subcommands start with this.
/nightops status [collection]
Show status overview or details for a specific collection.
Options:
- No argument: Show all collections
- Collection name: Show detailed status
Examples:
/nightops status
/nightops status staging-api
/nightops status "Staging API" # Quoted for spaces
/nightops start <collection>
Start a collection.
Options:
-r, --reason <text>: Add a reason (for audit log)--no-confirm: Skip confirmation dialog
Examples:
/nightops start staging-api
/nightops start staging-api -r "Debugging issue #123"
/nightops start staging-api --no-confirm
/nightops stop <collection>
Stop a collection.
Options:
-r, --reason <text>: Add a reason (for audit log)--force: Skip confirmation dialog
Examples:
/nightops stop dev-environment
/nightops stop dev-environment -r "Done for the day"
/nightops list
List all collections you have access to.
Options:
--status <status>: Filter by status (running, stopped, mixed)--env <environment>: Filter by environment tag
Examples:
/nightops list
/nightops list --status running
/nightops list --env staging
/nightops schedule
View schedule information.
Examples:
/nightops schedule # List all schedules
/nightops schedule staging-api # Show schedule for collection
/nightops link
Link your Slack account to NightOps.
/nightops whoami
Show your linked account and permissions.
/nightops help
Show command help.
Troubleshooting
Bot Not Responding
- Verify bot is in the channel:
/invite @NightOps - Check bot is online in Slack app directory
- Verify integration is active in NightOps settings
"Permission Denied"
- Check your NightOps account is linked:
/nightops whoami - Verify you have access to the collection
- Check channel permissions
Notifications Not Working
- Verify bot is in the notification channel
- Check notification settings are enabled
- Verify collection has correct channel configured
Commands Timing Out
- Check NightOps service status
- Verify cloud provider connectivity
- Try again in a few minutes
Security
Permissions
The NightOps Slack app requests minimal permissions:
- commands: Process slash commands
- chat:write: Send messages
- users:read: Map Slack users to NightOps accounts
Data Handling
- Slack messages are not stored
- Only command parameters are logged
- User mapping is stored securely
Audit Trail
All Slack commands are logged:
2024-01-15 10:30 alice@company.com (Slack) STARTED staging-api
2024-01-15 09:00 bob@company.com (Slack) STOPPED dev-environment
Best Practices
Channel Organization
#nightops-staging → Staging operations
#nightops-qa → QA environment
#nightops-alerts → All failure notifications
#production-ops → Production with approvals
Notification Routing
Failures → #nightops-alerts (for visibility)
Staging ops → #nightops-staging (for context)
Production → #production-ops + PagerDuty
Team Training
- Share command reference with team
- Demo common workflows
- Set up channel permissions appropriately
- Configure approval workflows for sensitive resources
Next Steps
- Configure calendar integration — Add uptime calendar
- View schedule examples — Common scheduling patterns
- Learn Slack overrides — Override schedules when needed