Recipes
Slack
Post phone notifications to a Slack channel with an incoming webhook.
1. Create an incoming webhook#
- Go to api.slack.com/apps and create an app in your workspace (Pick features, or From scratch in older interfaces).
- Open Incoming Webhooks, turn it on, then click Add New Webhook to Workspace and pick a channel.
- Copy the URL. It looks like
https://hooks.slack.com/services/T000/B000/XXXX.
The URL is the credential
Anyone with the URL can post to the channel. It's included in rule exports, so review exports before sharing them.
2. Create the rule#
Paste the URL as the Webhook URL, pick the source apps and use:
JSON template
{
"text": "*{{appName}}* · {{title}}\n{{text}}"
}Block Kit layout#
For a richer message, use blocks. Keep text as well, because Slack uses it for the notification preview.
The blocks below use plain_text so notification content isn't interpreted as Slack markup in those blocks. The simple template and top-level fallback text can still contain service-specific formatting; sanitize through a receiver if you must strictly control mentions or links.
JSON template (blocks)
{
"text": "{{appName}}: {{title}}",
"blocks": [
{
"type": "section",
"text": { "type": "plain_text", "text": "{{title}}\n{{text}}" }
},
{
"type": "context",
"elements": [
{ "type": "plain_text", "text": "{{appName}} · {{time.iso}}" }
]
}
]
}Good to know#
- Slack replies
200with the bodyok. - Errors may return
400,403or404with a short reason, such asinvalid_payload,action_prohibitedorno_service. You'll see it in the event log's response section. - A section's text must contain 1–3000 characters. Long notifications can cause
invalid_blocks; NotifyHook doesn't truncate them automatically. Use{{textPreview}}or a transforming receiver for strict limits. - Incoming webhooks use the channel, username and icon configured for the Slack app; those can't be overridden in this payload.
- Rate limits can return
429. NotifyHook uses its own backoff rather than Slack'sRetry-Aftervalue.
See Slack's incoming webhook guide and section limits.