Sending Alerts to Slack

Setting up Slack as an alerting channel is simple:

  1. Create an Incoming WebHook integration in Slack by selecting a default channel for your alerts. You’ll see a WebHook URL generated by Slack. Copy it.
  2. In Checkly, go to Alert Settings -> Add More Channels -> Slack and paste your URL to add it as an alerting channel:

Add a Slack WebHook URL to Checkly

You have the option to customize the default channel you’ve set in Slack by setting a channel name while creating your Alert Channel. You can use a #public-channel-name, @username for Direct Messages or a channel ID. If you omit this field, the message will arrive in the default channel you’ve picked while creating the Incoming WebHook URL in Slack.

By customizing the channel name, alerting options & checks for that alert channel, you can use a single Incoming WebHook URL for multiple scenarios.

If you’re using a free Slack workspace, be aware of message limits. Exceeding these limits may prevent new alerts from being delivered.

Example Failed Slack Alert

We provide a lot of information in the initial Slack message including links to the check and check result as well as the whole response body.

A slack message showing a failed alert

Example Recovered Slack Alert

From the recovered Slack message, you can see the timestamp as well as a link to the check itself.

A slack message showing a recovered alert

Custom Slack Webhook Integration

For users who need more control over the Slack alert format and content, you can use a Webhook Alert Channel in Checkly to send fully customized messages to Slack.

This approach is ideal when the native Slack integration does not meet your formatting or dynamic content needs. You will be using a Webhook alert channel with a Slack Incoming WebHook URL and a custom payload template. This setup allows you to control Slack message formatting using Slack’s Block Kit.

Steps

  1. Create a Slack Webhook

    • Create an Incoming WebHook integration in Slack by selecting a default channel for your alerts. You’ll see a WebHook URL generated by Slack. Copy it.
    • Choose the bot name and icon for your alerts.
  2. Create a Webhook Alert Channel in Checkly

    • Go to Alert Settings > Add More Channels > Webhook
    • Fill in the following:
      • Name: e.g. Custom Slack Alerts
      • Method: POST
      • URL: Paste the Slack Webhook URL
      • Notification events: Enable recovery, degraded, and failure. SSL expiry optional, but not supported in this template.
      • Body: See template below
  3. Customize the Template

The following template uses conditional logic ({{#if}}) to change the message depending on the alert type:

Body
{
  "attachments": [
    {
      {{#if (eq ALERT_TYPE "ALERT_FAILURE")}}
      "color": "#a30200",
      {{/if}}
      {{#if (eq ALERT_TYPE "ALERT_RECOVERY")}}
      "color": "#2eb886",
      {{/if}}
      {{#if (eq ALERT_TYPE "ALERT_DEGRADED_RECOVERY")}}
      "color": "#2eb886",
      {{/if}}
      {{#if (eq ALERT_TYPE "ALERT_DEGRADED")}}
      "color": "#daa038",
      {{/if}}
      "blocks": [
        {
          "type": "header",
          "text": {
            "type": "plain_text",
            "text": "Check Result Details",
            "emoji": true
          }
        },
        {
          "type": "section",
          "fields": [
            {
              "type": "mrkdwn",
              "text": "*Check:*\n<https://app.checklyhq.com/checks/{{CHECK_ID}}|{{CHECK_NAME}}>"
            },
            {{#if GROUP_NAME}}
            {
              "type": "mrkdwn",
              "text": "*Group:*\n{{GROUP_NAME}}"
            },
            {{/if}}
            {
              "type": "mrkdwn",
              "text": "*Type:*\n{{CHECK_TYPE}}"
            },
            {
              "type": "mrkdwn",
              "text": "*Started at:*\n{{STARTED_AT}}"
            },
            {
              "type": "mrkdwn",
              "text": "*Run Location:*\n`{{RUN_LOCATION}}`"
            },
            {
              "type": "mrkdwn",
              "text": "*Response Time:*\n{{RESPONSE_TIME}}ms"
            }
            {{#if API_CHECK_RESPONSE_STATUS_CODE}},
            {
              "type": "mrkdwn",
              "text": "*Status Code:*\n{{API_CHECK_RESPONSE_STATUS_CODE}} {{API_CHECK_RESPONSE_STATUS_TEXT}}"
            }
            {{/if}}
          ]
        },
        {{#if CHECK_ERROR_MESSAGE}}
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "*❌ Error Message:*\n```{{CHECK_ERROR_MESSAGE}}```"
          }
        },
        {{/if}}

        {{#if (eq ALERT_TYPE "ALERT_RECOVERY")}}
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "✅ *This check has recovered and is now passing successfully.*"
          }
        },
        {{/if}}

        {{#if (eq ALERT_TYPE "ALERT_DEGRADED_RECOVERY")}}
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "🟡 *This check has recovered from a degraded state.*"
          }
        },
        {{/if}}

        {{#if (eq ALERT_TYPE "ALERT_DEGRADED")}}
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "⚠️ *This check is running but performance is degraded.*"
          }
        },
        {{/if}}

        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "🔎 *View full result:*\n<{{RESULT_LINK}}|Click here to view details in Checkly>"
          }
        },
        {
          "type": "actions",
          "elements": [
            {
              "type": "button",
              "text": {
                "type": "plain_text",
                "text": "Runbook",
                "emoji": true
              },
              {{#if (eq CHECK_NAME "Check A")}}
              "url": "https://example.com/check-a",
              {{else if (eq CHECK_NAME "Check B")}}
              "url": "https://example.com/check-b",
              {{else}}
              "url": "https://example.com/default",
              {{/if}}
              "action_id": "open_link_button"
            },
            {
              "type": "button",
              "text": {
                "type": "plain_text",
                "text": "OTel Provider",
                "emoji": true
              },
              "url": "https://example.com",
              "action_id": "open_link_button_needs_to_be_unique"
            }
          ]
        },
        {
          "type": "context",
          "elements": [
            {
              "type": "plain_text",
              "text": "Tags: {{TAGS}} | UUID: {{CHECK_RESULT_ID}}",
              "emoji": false
            }
          ]
        }
      ]
    }
  ]
}

Be sure to update or remove the placeholder button links to Runbooks, OTel provider and anything else that is not needed for your use case.

Be sure each check mapped in the runbook logic has a corresponding URL. If a match isn’t found, fallback to a default documentation page.

Testing the Webhook Limitations

  • You cannot use the Test Webhook button in Checkly for this template, as Slack requires valid payload structure and the test payload lacks real check data.
  • To test, trigger a real alert by adjusting a check so it fails, degrades, and recovers.

Examples of Alert Transitions

A customized slack message showing a failed alert

A customized slack message showing a degraded alert

A customized slack message showing a recovered alert

A customized slack message showing a recovered alert from degraded state


Last updated on April 24, 2025. You can contribute to this documentation by editing this page on Github