# Set up Slack alerts

Slack alerts use a Slack **incoming webhook**, which is a URL that posts a message directly into a chosen
channel in your workspace. Under the hood a Slack contact is an `http` contact - HostTracker recognizes it
automatically from the webhook URL itself, with no separate gateway field to set.

## Settings reference

| Setting (UI label) | API field (v2) | Type / allowed values | Default | Plan limits | What it does for you |
|---|---|---|---|---|---|
| Contact Type | `type` | `"http"` | - | - | Slack is stored as a plain `http` contact |
| Webhook URL | `address` | A `https://hooks.slack.com/...` URL | - (required) | - | Where the message posts; HostTracker detects Slack automatically from this prefix |
| Group events | `groupedAlerts` | boolean | `false` | - | Combine simultaneous alerts into one message - see [grouped alerts](/alerts/grouped-alerts/) |

You can also set `gateway: "Slack"` explicitly (matching a legacy back-compat shape), but it isn't required -
the `hooks.slack.com` address prefix is checked unconditionally, ahead of every other gateway's rule.

## Set it up in the app

1. In Slack, create an **incoming webhook** for the channel you want alerts in (from your workspace's App
   Directory, search for "Incoming Webhooks" and add one, or use an existing Slack app with that permission).
   Copy the webhook URL Slack gives you.
2. In HostTracker, open **Contacts** and click **Add contact**.
3. Choose **Slack** (or add it as a webhook contact - a `hooks.slack.com` URL is recognized automatically).
4. Paste the webhook URL and give the contact a name.
5. Save.

## What the message looks like

Slack alerts render as **rich formatted cards**, not plain text - including for certificate, domain-expiry and
blacklist alerts, with the monitor name, status, and relevant details laid out in Slack's block format rather
than a raw text blob.

## Do it with the API or MCP

```
POST /contact
{ "type": "http", "address": "https://hooks.slack.com/services/...", "name": "Team Slack" }
```

MCP: creating a Slack contact isn't covered by the `create_contact` tool (it only creates `email`/`sms`/
`voiceCall`/`webPush`) - use `api_request` with the body above.

## What happens next

An `http` contact is born confirmed - there's no code to verify, since posting a real message to the webhook
*is* the proof it works. [Send a test alert](/alerts/test-a-contact/) to confirm delivery before relying on it.

## Limits and gotchas

- Alerts always land in whichever channel the webhook is bound to in Slack. To alert a different channel,
  create a new incoming webhook there and add it as a separate contact.
- Grouping is **off** by default. Turn on the contact's **Group events** toggle to combine simultaneous alerts
  to the same webhook into one message instead of flooding the channel.
- If Slack ever revokes or regenerates the webhook URL, HostTracker has no way to know - a test alert is the
  fastest way to notice.
- Being a **recognized gateway** also means Slack can receive certificate-expiry, domain-expiry, DNSBL
  blacklist and Web Risk notices - a plain unrecognized webhook contact cannot (see
  [Webhook](/alerts/channels/webhook/#limits-and-gotchas)).

## Related

- [Microsoft Teams](/alerts/channels/teams/) - [Mattermost](/alerts/channels/mattermost/)
- [Webhook](/alerts/channels/webhook/)
- [All channels](/alerts/channels/)
