Connect Lensmor Agent to Slack

A step-by-step guide to guide you to generate Slack App Token & Bot Token

Written By joyce

Last updated About 1 month ago

Step 1: Create a Slack App

  1. Go to https://api.slack.com/apps and click Create New App.

  2. Select From scratch.

  3. Enter an App Name (e.g., Lensmor Event Assistant) and select your Workspace from the dropdown.

  4. Click Create App.


Step 2: Get Your App Token

  1. After created app and you will be redirected to your app dashboard, go to Settings → Basic Information.

    Scroll down to the App-Level Tokens section and click Generate Token and Scopes.

  2. Enter a Token Name (e.g., lensmortoken).

  3. Click Add Scope and select connections:write from the list.

  4. Click Generate.

  5. Copy the token — it starts with xapp-. Save it somewhere safe, you'll need it shortly.


Step 3: Configure Permissions & Enable Socket Mode

Enable Socket Mode

  1. Go to Settings → Socket Mode.

  2. Toggle Enable Socket Mode to On.

Add Bot Token Scopes

  1. Go to Features → OAuth & Permissions.

  2. Scroll down to Scopes → Bot Token Scopes.

  3. Click Add an OAuth Scope and add the following scopes:

Scope

Description

app_mentions:read

View messages that directly mention your app

channels:history

View messages and content in public channels

channels:read

View basic information in public channels

chat:write

Send messages as your app

files:read

View files shared in channels and conversations

groups:history

View messages and content in private channels

groups:read

View basic information in private channels

im:history

View messages in direct messages

im:read

View basic info about direct messages

im:write

Start direct messages with people

mpim:history

View messages in group direct messages

mpim:read

View basic informtion in group direct messages

reactions:read

View emoji reactions in channels and conversations

reactions:write

Add and edit emoji reactions

users:read

View people in a workspace

Enable Event Subscriptions

  1. Go to Features → Event Subscriptions.

  2. Toggle Enable Events to On.

  3. Under Subscribe to bot events, click Add Bot User Event and add:

    • app_mention

    • message.im

  4. Click Save Changes.


Step 4: Get Your Bot Token

  1. Go to Features → OAuth & Permissions.

  2. Click Install to Workspace at the top of the page.

  3. Review the requested permissions and click Allow.

  4. You'll now see your Bot User OAuth Token — it starts with xoxb-.

  5. Copy and save this token.


Step 5: Connect to Lensmor

  1. Go back to Lensmor and open Bot Settings.

  2. Paste your App Token (xapp-...) into the App Token field.

  3. Paste your Bot Token (xoxb-...) into the Bot Token field.

  4. Click Connect to activate your Slack Bot.


Step 6: Add Lensmor Agent to channel

  1. Add the newly added bot to channel

  2. Start chating with your bot!