NotifyHookDocs
Recipes

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:

Text
https://discord.com/api/webhooks/123456789012345678/AbCdEf…
The URL is the credential

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:

JSON template
{
  "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#

JSON template (embed)
{
  "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 200 with the created message when wait=true, or normally 204 No Content with the default wait=false.
  • allowed_mentions: {"parse":[]} prevents notification text from pinging users, roles or everyone. JSON escaping alone doesn't stop mentions or Markdown formatting.
  • content is limited to 2000 characters. Longer messages get 400 and 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_id in the URL or thread_name in 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.