--- title: "Send alerts to Slack" description: "Create a Slack monitoring integration with an Incoming Webhook URL or a bot token and channel ID, and test it before use." content_type: "how-to" product: "alerts" platform: "TIR" url: "/tir/alerts/how-to/send-alerts-to-slack/" topic: ["set-up-notifications"] --- # Send alerts to Slack Create a monitoring integration that posts alert notifications to a Slack channel. You can connect with an Incoming Webhook URL or with a bot token, and you choose one when you create the integration. | Method | Use when | You need | | ------- | -------------------------------------------------------- | ----------------------------- | | Webhook | You want a fast setup for a single channel. | An Incoming Webhook URL. | | Token | You need several channels or tighter control of the app. | A bot token and a Channel ID. | The webhook method is the simpler start. Choose the token method for several channels, for control from your own code, or for tighter control over the app's permissions and the bot's identity. The steps in Slack follow Slack's own screens, so they can change. If a screen looks different, check [Slack's documentation](https://api.slack.com/). ## Before you begin You need a TIR project and a role with Create permission on monitoring integrations. You need a Slack workspace where you can create apps. ## Connect with a webhook URL ### Create the Slack side 1. If you need a workspace, go to [slack.com/get-started](https://slack.com/get-started), select **Create a new workspace**, enter and verify your email, and name the workspace. Create a channel for alerts, for example `alerts-test`. 2. Go to [api.slack.com/apps](https://api.slack.com/apps) and select **Create New App**, then **From scratch**. Name the app, for example `Alert System`, pick your workspace, and select **Create App**. 3. In the app, open **Incoming Webhooks** and turn on **Activate Incoming Webhooks**. 4. Select **Add New Webhook to Workspace**, choose the channel for alerts, and select **Allow**. 5. Copy the URL. It looks like `https://hooks.slack.com/services/T.../B.../...`. It is the credential you give TIR. The URL belongs to the channel you chose. If you create a new URL in Slack, the old one stops working, so paste the new URL into the integration. ### Create the integration in TIR 1. In **Alert Management**, select **Manage Monitoring Integrations**, then **Create Monitoring Integration**. 2. Enter an **Integration name** and, if you like, a **Description**. 3. Set **Contact point type** to **Slack**. 4. Under **Select Slack Channel**, choose **Webhook**. 5. Paste the URL into **Webhook URL**. It must start with `https://hooks.slack.com/services/`. 6. Select **Test URL** before you save. A sample message arrives in your channel and TIR reports success. If no message arrives, check that the URL is complete and the channel exists. 7. Select **Create integration**. ## Connect with a bot token ### Create the Slack side 1. Go to [api.slack.com/apps](https://api.slack.com/apps) and open your app. If you need one, do steps 1 and 2 of the webhook method. 2. Open **OAuth & Permissions**. Under **Bot Token Scopes**, select **Add an OAuth Scope** and add `chat:write`. Use `chat:write`, not `chat:write.public`. The first lets the bot post only in channels it has joined. The second lets it post in every public channel without joining, which is more access than alerts need. 3. Open **Install App** and select **Allow** to install the app in your workspace. 4. Copy the **Bot User OAuth Token**. It starts with `xoxb-`. Store it securely: it gives access to your Slack workspace as the bot. 5. In the Slack channel for alerts, run `/invite @`, for example `/invite @Alert System`. The bot posts only in channels it has joined, public or private, so alert messages arrive only after this step. 6. Open the channel's name at the top, scroll to the bottom of the details, and copy the **Channel ID**. It looks like `C12345678`. TIR needs the ID, not the channel name. ### Create the integration in TIR 1. In **Alert Management**, select **Manage Monitoring Integrations**, then **Create Monitoring Integration**. 2. Enter an **Integration name** and, if you like, a **Description**. 3. Set **Contact point type** to **Slack**, and under **Select Slack Channel** choose **Token**. 4. Enter the **Bot token**. It must start with `xoxb-`. 5. Enter the **Channel ID**. It starts with C, G, or D, followed by at least eight capital letters or digits. 6. Select **Test Token** before you save. A sample message arrives in your channel and TIR reports success. 7. Select **Create integration**. ## Confirm the integration The integration is in **Manage Monitoring Integrations**. After you [create an alert](/tir/alerts/how-to/create-an-alert/) with it and [attach the alert](/tir/alerts/how-to/attach-an-alert-to-a-resource/) to a running resource, every notification for that alert goes to your Slack channel. Each message is titled `[FIRING:1]` or `[RESOLVED:1]`, followed by the alert and project names. See [What a notification contains](/tir/alerts/concepts/what-a-notification-contains/). TIR reports a Slack error only when you run a test, so a live alert can fail silently. If an alert goes missing, run the test again and see [Troubleshooting Slack alerts](/tir/alerts/troubleshooting/slack/).