> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack integration

> Post a formatted Slack message after every completed call: TL;DR, summary, next steps, and AMD verdicts. One-minute setup with an incoming webhook.

The Slack integration posts a formatted message to your channel the moment a
call completes: the TL;DR up top, then the summary, next steps, and call
metadata. AMD decisions post a compact card with the verdict and confidence.

## What you need

* A **Slack incoming webhook URL** for the target channel. Create one in
  Slack: your workspace → **Apps** (or api.slack.com/apps) → **Incoming
  Webhooks** → **Add to Slack** → pick the channel → copy the
  `https://hooks.slack.com/services/...` URL.
* Each channel gets its own connection with its own events, so create one
  webhook per channel you want messages in.

## Connect

1. In PyAI Console, open **Integrations** and find **Slack** under
   Notifications.
2. Click **Connect**, paste the webhook URL, and pick your events:
   **Call recap ready** (summaries), **AMD decision** (answer detection), or
   both.
3. Press **Test**. A sample message lands in the channel immediately.
4. Done. Every completed call posts from then on.

## What lands

```
:clipboard: Call recap ready
*Customer asked to reschedule Friday's installation to next week.*

Call: call_8fK2mQ9xR4    Status: completed
Pack: support_v1         Customer: +1 (555) 123-4567

The customer called to move their appointment. The agent offered
Tuesday or Wednesday morning; the customer chose Wednesday 9-11am.

*Next steps*
Confirm the new slot by SMS and update the calendar invite.
```

AMD messages carry the verdict, confidence, decision time, and reason instead
(for example: human at 97%, voicemail at 92%).

## Troubleshooting

* **Error: invalid webhook URL.** The URL must be an
  `https://hooks.slack.com/...` incoming webhook. Other Slack URLs (app
  management, workflow builder) do not work.
* **Test fails with `channel_not_found` or `no_service`.** The webhook was
  deleted or the channel archived in Slack. Create a fresh webhook and update
  the connection (secrets/URLs are preserved unless you replace them).
* **Messages stopped after a Slack outage.** Deliveries retry eight times
  over about twenty minutes and resume automatically; the card shows the last
  error only if all retries failed.
