Slack
Connect a Slack bot to receive approval requests in your workspace and reply to approve or deny held actions without needing to be at your terminal.
How it works
Belay uses a Slack bot token to post a message to a channel when an agent action is held for approval. You reply in that channel to approve or deny it. A bot token is required (rather than an incoming webhook) because Belay needs to read your reply.
Setup
Setup has two parts: creating the Slack app and registering it with Belay.
Part 1: Create a Slack app
Create a new Slack app. Go to api.slack.com/apps and create an app from scratch in your workspace. You can give the app any name.
Install the app to your workspace. Click Install to Workspace.
Copy the bot token. After installing, copy the Bot User OAuth Token. It starts with
xoxb-. You will need this when registering with Belay.Invite the bot to the channel. In Slack, open the channel you want Belay to use and invite the bot. You can use
/invite @your-bot-namein the channel.
Part 2: Register with Belay
Register the Slack bot as a notification channel.
bash$ belay notifications add slack-bot
Belay prompts you for the bot token environment variable and the channel ID.
Add yourself as an approver. Replace
U0YOURIDwith your Slack member ID. You can find it under your profile in Slack (click your name, then the three-dot menu, then Copy member ID).bash$ belay approver add slack:U0YOURID
Restart the daemon.
bash$ belay daemon restart
Verify the integration
$ belay channels test
Prefer Telegram? See Telegram setup, which uses the interactive belay connect telegram command.
