# Slack destinations

Post alerts to a Slack channel with an incoming webhook, and check it works with a test message.

A Slack destination posts alerts into one Slack channel. You create an incoming webhook for the channel in Slack, paste its URL into APX, and APX posts a test message before it saves anything, so you know it works.

## Before you start

You need to be able to add an app to your Slack workspace. If your Slack workspace restricts apps, ask whoever manages Slack to approve it or to create the webhook for you.

## Create the webhook in Slack

These are Slack's steps; the names of Slack's buttons can change, so follow Slack's own help if they differ.

1. Go to api.slack.com/apps and create a new app from scratch. Give it a name your team will recognise, such as "APX alerts", and pick your Slack workspace.
2. In the app's settings, open **Incoming Webhooks** and turn it on.
3. Add a new webhook to the workspace, choose the channel alerts should post to, and allow it.
4. Copy the webhook URL. It starts with `https://hooks.slack.com/services/`.

If your workspace already has Slack's Incoming Webhooks app installed, you can add a webhook for the channel from there instead.

> **Warning:** Anyone who has the webhook URL can post to that channel. Treat it like a password: paste it into APX and nowhere else.

## Add it in APX

If you manage the workspace:

1. Go to **Settings**, then **Alerts**, then the **Configure** tab.
2. Under **Destinations**, select **Add destination**.
3. Under **Where should alerts go?**, choose **Slack** and select **Next**.
4. Fill in the details:
   - **Channel**: how the channel shows up in APX, for example `#qa-alerts`. This is only a label; the webhook decides where messages go.
   - **Webhook URL**: paste the URL from Slack. APX encrypts it and never shows it again.
   - **Name**: how it shows up in routing and the Alert log. Leave it blank to use the channel.
   - **After the first alert, group follow-ups for**: see [Grouping](/docs/alerts/overview#grouping-one-message-not-twenty).
5. Select **Add destination**. The button reads **Checking…** while APX posts a test message.

If Slack accepts the test, the destination is saved as **Active** and the last step says **Test message sent to** your channel. In Slack you'll see **APX alerts connected**. If Slack rejects it, nothing is saved and the error says why; fix the URL and try again.

There is no confirmation step for Slack: the test message is the check.

Next, point a rule at the new destination, as described in [Routing rules](/docs/alerts/rules).

## What an alert looks like in Slack

A single alert shows the agent's name with the score and threshold (for example "Sales Coaching · 54 / 70"), a line saying the call scored below the threshold, your workspace name, when the call happened, and a **View call** button.

A summary of several calls lists them under each agent, each score linking to its call, then a link to the Alert log ("and" a number "more in the Alert log" when there are more than 10).

Slack messages never include transcript text, phone numbers or caller names. Opening a call needs an APX sign-in.

## Managing a Slack destination

Each destination's menu has **Send test**, **Pause** or **Resume**, **Edit** (name and grouping window), **Replace webhook URL**, **View activity** and **Delete**.

To point alerts at a new webhook, select **Replace webhook URL** and paste it into **New webhook URL**. APX sends a test message to the new URL before saving it; leave the field blank to keep the current one.

## Troubleshooting

**Adding the destination fails with "Slack webhook URLs start with https://hooks.slack.com/services/".** The URL isn't a Slack incoming webhook. Copy it again from the webhook settings in Slack.

**"Slack says this webhook no longer exists."** The webhook was removed, its app was uninstalled, or the channel was archived. Create a new webhook in Slack, then use **Replace webhook URL**.

**The destination shows Error and a banner says alerts stopped.** Deliveries kept failing, so APX stopped posting. Select **Replace webhook URL** on the banner or in the menu and paste a working URL: once its test message goes through, alerts restart. If the old URL works again, **Resume** tests it first and then restarts alerts.

**An alert shows Failed with "Slack is rate limiting this webhook".** When Slack asks APX to slow down, APX waits and retries on its own, several times over roughly 40 minutes. If it still couldn't post, the alert shows **Failed**; select **Retry** in its menu in the **Log** tab.

**The log says APX may already have posted an alert.** Very occasionally APX can't tell whether a Slack post went through. Rather than risk posting twice, it doesn't re-send. Check the channel.
