# How to set up a Slack bot

To be able to send [event notifications](https://docs.b2core.b2broker.com/back-office-guide/system/event-notifications) in Slack, set up a Slack bot and obtain a token for its managing.

{% hint style="info" %}
This instruction is created based on the latest version of Slack as of this writing. Due to possible changes to the procedures described here, we suggest that you consult the official [Slack documentation](https://slack.com/help) or contact their support in case you have any questions.
{% endhint %}

To set up a Slack bot:

{% stepper %}
{% step %}
Go to the Slack website and create a [Slack app](https://api.slack.com/apps?new_app=1).
{% endstep %}

{% step %}
In the **Create an app** window, click **From scratch**, and then fill in the following fields:

* In the **App name** field, enter a name for your Slack bot. The bot name can be changed afterwards.
* Select a Slack workspace for which you want to create the bot. The workspace cannot be changed.
  {% endstep %}

{% step %}
Click **Create App**.
{% endstep %}

{% step %}
In the main menu, click **App Home**.
{% endstep %}

{% step %}
On the **App Home** page, click **Review Scopes to Add**.
{% endstep %}

{% step %}
Navigate to the **Scopes** section, click **Add an OAuth Scope**, and then add the following permission scopes to your bot:

* `chat:write`
* `chat:write.public`
* `users:read`
* `users:read.email`

For a list of all available permission scopes, refer to [Permission scopes](https://api.slack.com/scopes).

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-cf25f34713f276d6af3b477be63c30edcd7d49af%2Fadd-slack-bot-scopes.png?alt=media" alt="Add Slack bot scopes"><figcaption><p>Add Slack bot scopes</p></figcaption></figure>
{% endstep %}

{% step %}
Navigate to the **OAuth Tokens for Your Workspace** section and click **Install to Workspace**.

After installing the app, copy the token for managing your Slack bot, which is displayed in the **Bot OAuth User Token** field.

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-6f20aff3766ff3988c369b06da6fe85dc162290e%2Fcopy-slack-bot-token.png?alt=media" alt="Copy a Slack bot token"><figcaption><p>Copy a Slack bot token</p></figcaption></figure>
{% endstep %}

{% step %}
In the B2CORE Back Office, navigate to **Systems** > **Settings**.
{% endstep %}

{% step %}
Paste the copied token into the **Bot token** field displayed under the **SlackBot** section.
{% endstep %}

{% step %}
Click **Save** to apply the changes.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**See also**

[How to set up event notifications](https://docs.b2core.b2broker.com/how-to-articles/manage-system-settings/how-to-set-up-event-notifications)
{% endhint %}
