Site: Planekeeper Docs — Monitor software versions across your stack. Planekeeper tracks releases, gathers version data, and alerts on drift.
Section: Recipes > Send notifications to Slack
Source: https://docs.planekeeper.com/recipes/slack-notifications/
Title: Send notifications to Slack
Author: Planekeeper
Description: Set up Slack webhook notifications with simple text templates and Block Kit JSON templates for rich formatting.
Word count: 525
Reading time: 3 min

Contents:
- [Prerequisites](#prerequisites)
- [Step 1: Create a Slack incoming webhook](#step-1-create-a-slack-incoming-webhook)
- [Step 2: Create a notification channel in Planekeeper](#step-2-create-a-notification-channel-in-planekeeper)
- [Step 3: Add Slack templates](#step-3-add-slack-templates)
- [Step 4: Test the channel](#step-4-test-the-channel)
- [Step 5: Create a notification rule](#step-5-create-a-notification-rule)
- [Routing different severities to different channels](#routing-different-severities-to-different-channels)

***

# Send notifications to Slack


This recipe configures Planekeeper to send alert notifications to a Slack channel. Slack supports both simple text messages and rich Block Kit formatting through incoming webhooks.

---

## Prerequisites

- A running Planekeeper instance with at least one alert config
- A Slack workspace where you can create apps

---

## Step 1: Create a Slack incoming webhook

1. Go to [api.slack.com/apps](https://api.slack.com/apps) and click **Create New App**
2. Choose **From scratch**, name it `Planekeeper`, and select your workspace
3. Go to **Incoming Webhooks** and toggle it **On**
4. Click **Add New Webhook to Workspace**
5. Select the channel where you want notifications
6. Copy the webhook URL

The URL looks like: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`

---

## Step 2: Create a notification channel in Planekeeper

1. Navigate to **Notification Channels** in the sidebar
2. Click **Create Channel**
3. Fill in the fields:

| Field | Value |
|-------|-------|
| Name | `Slack Alerts` |
| Channel Type | `webhook` |
| URL | Paste your Slack webhook URL |

4. Check **Use Event-Specific Templates**
5. Add the templates from step 3 below
6. Click **Create**

---

## Step 3: Add Slack templates

Choose either simple text templates or Block Kit templates depending on how much formatting you want.

**Simple text**

    ### New alert template

    ```json title="New Alert / Escalated"
    {"text": ":rotating_light: *{{.Alert.Severity | upper}}*: {{.Alert.ConfigName}}\nArtifact: {{.Alert.ArtifactName}}\nVersion {{.Alert.DiscoveredVersion}} is {{.Alert.BehindBy}} behind latest ({{.Alert.LatestVersion}})\n<{{.AcknowledgeURL}}|Click to Acknowledge>"}
    ```

    ### Acknowledged template

    ```json title="Acknowledged / Unacknowledged"
    {"text": "{{if .IsAcknowledged}}:white_check_mark: *Acknowledged*{{else}}:arrows_counterclockwise: *Unacknowledged*{{end}}: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}{{if .IsAcknowledged}}\nAcknowledged by {{.AcknowledgedBy}}{{end}}"}
    ```

    ### Resolved template

    ```json title="Resolved"
    {"text": ":tada: *Resolved*: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}\nThe alert has been automatically resolved."}
    ```

**Block Kit (rich format)**

    ### New alert template

    ```json title="New Alert / Escalated (Block Kit)"
    {"blocks": [{"type": "header", "text": {"type": "plain_text", "text": "{{.Alert.Severity | upper}} Alert"}}, {"type": "section", "fields": [{"type": "mrkdwn", "text": "*Config:*\n{{.Alert.ConfigName}}"}, {"type": "mrkdwn", "text": "*Artifact:*\n{{.Alert.ArtifactName}}"}, {"type": "mrkdwn", "text": "*Current:*\n{{.Alert.DiscoveredVersion}}"}, {"type": "mrkdwn", "text": "*Latest:*\n{{.Alert.LatestVersion}}"}]}, {"type": "actions", "elements": [{"type": "button", "text": {"type": "plain_text", "text": "Acknowledge"}, "url": "{{.AcknowledgeURL}}", "style": "primary"}]}]}
    ```

    ### Acknowledged template

    ```json title="Acknowledged / Unacknowledged (Block Kit)"
    {"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": "{{if .IsAcknowledged}}:white_check_mark: *Acknowledged*: {{.Alert.ConfigName}}\nBy {{.AcknowledgedBy}}{{else}}:arrows_counterclockwise: *Unacknowledged*: {{.Alert.ConfigName}}{{end}}"}}]}
    ```

    ### Resolved template

    ```json title="Resolved (Block Kit)"
    {"blocks": [{"type": "section", "text": {"type": "mrkdwn", "text": ":tada: *Resolved*: {{.Alert.ConfigName}} - {{.Alert.ArtifactName}}\nThe alert has been automatically resolved."}}]}
    ```

---

## Step 4: Test the channel

1. Go to **Notification Channels** and find `Slack Alerts`
2. Click **Test**
3. Check your Slack channel for the test message
4. If the test fails, verify:
    - The webhook URL is correct
    - The Slack app is still installed in your workspace
    - The target channel still exists

---

## Step 5: Create a notification rule

1. Navigate to **Notification Rules** in the sidebar
2. Click **Create Rule**
3. Fill in the fields:

| Field | Value |
|-------|-------|
| Name | `All Alerts to Slack` |
| Channel | Select `Slack Alerts` |
| Severity Filter | Leave empty (matches all severities) |
| Event Filter | Leave empty (matches all events) |

4. Click **Create**

---

## Routing different severities to different channels

Create separate Slack channels and notification rules for different severity levels:

| Notification rule | Severity filter | Slack channel |
|------------------|-----------------|---------------|
| Critical to Pager Channel | `critical` | #ops-critical |
| High to Alerts Channel | `high` | #ops-alerts |
| Moderate to Info Channel | `moderate` | #ops-info |

This requires creating three notification channels in Planekeeper (one per Slack channel) and three notification rules with different severity filters.

> **success:** 
**Use Block Kit for critical alerts**

Block Kit formatting with the acknowledge button is especially useful for critical alerts where you want one-click acknowledgment directly from Slack.



---

## Related

- Section: [Recipes](https://docs.planekeeper.com/recipes/index.md)
