Docs
Slack
Docs/Slack

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

  1. 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.

  2. Install the app to your workspace. Click Install to Workspace.

  3. Copy the bot token. After installing, copy the Bot User OAuth Token. It starts with xoxb-. You will need this when registering with Belay.

  4. 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-name in the channel.

Part 2: Register with Belay

  1. 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.

  2. Add yourself as an approver. Replace U0YOURID with 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
  3. Restart the daemon.

    bash
    $ belay daemon restart

Verify the integration

bash
$ belay channels test

Prefer Telegram? See Telegram setup, which uses the interactive belay connect telegram command.