Skip to content
Stand with Ukraine flag

Slack Settings

Integrating Slack with ThingsBoard lets users receive notifications in Slack channels or direct messages based on notification rules — for example, device status changes or detected issues.

You can follow the official Slack guide or complete the steps below.

  1. Go to api.slack.com/apps and click Create an App.
  2. In the Create an app dialog, select From a manifest.
  3. Select your workspace from the dropdown and click Next.
  4. Review the manifest and click Next.
  5. Review the app summary and click Create.
  6. On the app configuration page, navigate to OAuth & Permissions in the left sidebar.
  7. Scroll to the Scopes section. Under Bot Token Scopes, click Add an OAuth Scope and add all scopes listed in the table below.
  8. Scroll to the top of the OAuth & Permissions page and click Install to my workspace.
  9. Review the requested permissions and click Allow.
  10. Copy the Bot User OAuth Token under OAuth Tokens. This is the Slack API token you will use in ThingsBoard.
ScopeDescription
channels:joinJoin public channels in a workspace
channels:readView basic information about public channels in a workspace
chat:writeSend messages as the app
chat:write.customizeSend messages as the app with a customized username and avatar
groups:readView basic information about private channels the app has been added to
im:readView basic information about direct messages the app has been added to
mpim:readView basic information about group direct messages the app has been added to
mpim:write.topicSet the description in group direct messages
usergroups:readView user groups in a workspace
users:readView people in a workspace

Both system administrators and tenant administrators can configure Slack settings. Tenant-level settings override the system defaults.

  1. Navigate to Settings and open the Notifications tab.
  2. Paste the Bot User OAuth Token into the Slack api token field and click Save.

Once configured, ThingsBoard will deliver Slack notifications according to your notification rules.

If the Slack API token expires or is revoked, notification deliveries will fail. You can see delivery failures in the Sent tab of the Notification center. To resolve, generate a new token from the Slack app’s OAuth & Permissions page and update the settings in ThingsBoard.

Error: Slack API error: {"ok":false,"warning":null,"error":"invalid_auth","needed":null,...}

ThingsBoard cannot authenticate to the Slack API. The problem is with the token, not the channel or bot configuration.

Common causes:

  • Token copied with extra spaces or characters
  • Token expired or revoked
  • User token (xoxp-) used instead of a Bot token (xoxb-)
  1. Go to api.slack.com/apps, open your app, and navigate to OAuth & Permissions.
  2. Copy the Bot User OAuth Token. It starts with xoxb-.
  3. Paste the token into ThingsBoard with no leading or trailing spaces and no quotes.
  4. If you recently added or changed scopes, click Reinstall to Workspace first to generate a fresh token.

Error: Slack API error: app needs to be added to the channel

ThingsBoard is trying to send a message to a Slack channel, but the bot does not have access to that channel.

To add the bot to the channel:

  1. In Slack, open the channel you want the bot to post to.
  2. Type /invite @<bot_name> in the message box and press Enter, or go to Channel > Settings > Integrations > Add apps and select your app.

Also verify:

  • The channel ID or name configured in ThingsBoard is correct.
  • The bot has the required scopes (chat:write, channels:join, etc.) — see Required OAuth scopes.
  • The app is installed in the workspace.

The Send Slack Message on Alarm recipe walks through the full setup: configuring a Slack recipient, creating an alarm notification template, and setting up a rule that sends a message when an alarm is created.