Skip to content

Slack

Send alerts to a Slack channel using an incoming webhook.

Setup

  1. Go to Slack → Manage apps → Incoming Webhooks → Add to Slack
  2. Choose the destination channel and click Authorize
  3. Copy the webhook URL (https://hooks.slack.com/services/...)

Adding a Slack channel

wnp notify add-channel <check-id> \
  --type slack \
  --config url=https://hooks.slack.com/services/T.../B.../...
curl -X POST https://api.wanepia.com/v1/checks/{check_id}/policy/channels \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_type": "slack",
    "config": {
      "url": "https://hooks.slack.com/services/T.../B.../..."
    }
  }'

Payload format

Wanepia sends a Slack block-kit message:

{
  "text": "payments-api is now DOWN",
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*payments-api* transitioned *up → down*\nReason: 3 consecutive failures"
      }
    }
  ]
}

Message colours

Status Colour
down Red
degraded Yellow / orange
up (recovery) Green

Troubleshooting

  • channel_not_found: the webhook app was removed from the workspace or the channel was deleted. Re-create the webhook.
  • no_service: the webhook URL is malformed. Check for extra whitespace.
  • Check delivery status with wnp notify logs.