---
title: Send notifications to Slack
description: Post account events, such as failed runs, raised alerts, and
  revoked tokens, to a Slack channel through an incoming webhook.
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

If your team watches a Slack channel, Prefactor can post account events there: a run that failed, an alert that was raised, a token that was revoked. You connect the channel with a Slack incoming webhook and choose which events to send.

By the end, Slack shows as **Configured** on the Integrations tab, your chosen events post to the channel, and a test message has arrived.

## Before you start

- Your admin user has the **Full access** role. A Read only user can't save integration settings.
- You've picked one channel. An account has one Slack integration, and every selected event posts to that channel for every agent in the account.
- You've created an incoming webhook for that channel by following [Slack's guide to incoming webhooks](https://docs.slack.dev/messaging/sending-messages-using-incoming-webhooks/), and copied its URL. It starts with `https://hooks.slack.com/services/`. Treat it as a secret: anyone who has it can post to the channel.

## Connect it in Prefactor

1. Open the user menu at the top right and select **Account settings**.

   The [Account page](/web-app/account) opens on the **Details** tab.

2. Select the **Integrations** tab.

   Each integration is listed and marked **Configured** or **Not configured**.

3. Select **Slack**.

   The **Slack notifications** page opens, with the **Incoming webhook URL** field (1), the list of **Events** (2), and a test panel with **Send test notification** (3).

   ![The Slack notifications page, with markers on Incoming webhook URL (1), Events (2) and Send test notification (3).](../../../assets/screenshots/web-app/account-integrations-slack.png)

4. Paste the URL into **Incoming webhook URL**.

5. Under **Events**, tick the events you want posted, or select **Select all**.

   Events are grouped by what they're about: Agent, Version and deployment, Agent instance, User, API token, Environment and team, and Alert. A common starting set is **Agent instance failed**, **Agent instance terminated**, and **Alert raised**. Nothing is sent for an event you leave unticked.

6. Select **Save Slack settings**.

   Prefactor shows **Slack integration saved**. The webhook field is now masked, with an **Edit** button beside it, and Prefactor won't show the URL again.

## Test it

7. Under **Test notification**, select **Send test notification**.

   The panel shows **Slack accepted the test notification.**, and "Test notification from Prefactor." appears in the channel.

## Verify

Go back to the **Integrations** tab: Slack shows **Configured**. The next time one of your selected events happens, a message appears in the channel naming who made the change, and most messages end with a **View in Prefactor** button.

## If it didn't work

- **Saving shows "Webhook URL must be an HTTPS URL on hooks.slack.com".** The URL isn't a Slack incoming webhook. Copy it again from the webhook's settings in Slack.
- **The test fails with an error from Slack.** Slack rejected the webhook, for example because someone deleted it. Create a new webhook, select **Edit**, paste the new URL, and save.
- **The test works but an event never posts.** The event isn't ticked, or it happened on a sample agent Prefactor creates for demos; events about those agents are skipped. Check the event list and save again.
- **Notifications stopped after working.** Slack started rejecting the webhook, and Prefactor stops sending until you save a working URL. Replace the URL with **Edit**.
- **Messages go to the wrong channel.** The webhook belongs to that channel. Create a webhook for the right one and replace the URL with **Edit**.

To turn notifications off entirely, select **Remove integration** on the Slack notifications page. It deletes the saved webhook and event choices, and every Slack notification for the account stops.

## Other ways to do this

The API creates the integration with [POST /api/v1/account_integration](/api/platform/operations/actionaccountintegrationcreate) and sends a test with [POST /api/v1/account_integration/{account_integration_id}/test](/api/platform/operations/actionaccountintegrationtest).

## Related

- [Account notifications](/platform/notifications) — what a message contains and what to expect from delivery.
- [Account › Integrations tab](/web-app/account/integrations) — every event and what triggers it.
- [Alert](/platform/concepts/alert) — what the alert events announce.
- [Triage alerts](/guides/triage-alerts) — what to do when an alert lands in the channel.