Discord
Post phone notifications to a Discord channel with a channel webhook.
1. Create a Discord webhook#
In Discord, open Server Settings → Integrations → Webhooks → New Webhook, choose the channel and click Copy Webhook URL. It looks like:
https://discord.com/api/webhooks/123456789012345678/AbCdEf…Anyone with this URL can post to your channel. It's stored in the rule as a normal URL and included in rule exports. Review exports before sharing them.
2. Create the rule#
Paste the URL as the Webhook URL, pick the source apps and replace the template with:
{
"username": "{{appName}}",
"content": "**{{title}}**\n{{text}}",
"allowed_mentions": { "parse": [] }
}Discord shows the notification as a message posted by a "user" named after the source app.
Add ?wait=true to the webhook URL (or &wait=true if it already has a query) to wait for Discord's confirmation. The default wait=false can return success without reporting that a message wasn't saved.
Richer messages with embeds#
{
"username": "NotifyHook",
"allowed_mentions": { "parse": [] },
"embeds": [
{
"title": "{{title}}",
"description": "{{text}}",
"color": 13172541,
"footer": { "text": "{{appName}} · {{device.model}}" },
"timestamp": "{{time.iso}}"
}
]
}13172541 is NotifyHook's lime, #C8FF3D, as a decimal number. {{device.model}} is a Pro variable. Remove it on the free tier.
Good to know#
- Discord replies
200with the created message whenwait=true, or normally204 No Contentwith the defaultwait=false. allowed_mentions: {"parse":[]}prevents notification text from pinging users, roles or everyone. JSON escaping alone doesn't stop mentions or Markdown formatting.contentis limited to 2000 characters. Longer messages get400and aren't retried. An embed allows a 4096-character description, but its title is limited to 256 and all embeds together to 6000 characters. NotifyHook doesn't truncate automatically; use{{textPreview}}for a shorter source value or a transforming receiver for strict limits.- An empty message is rejected with
400. Don't rely on missing variables or Markdown markers to produce useful content. - Forum/media channels also require
thread_idin the URL orthread_namein the payload. Start with a normal text channel if you don't need threads. - Rate limits return
429, which NotifyHook retries automatically.
See Discord's Execute Webhook reference for current payload rules.