Discord Webhook Automation: Server Stats, Alerts, and Notifications in 2026
Webhooks are Discord's lightweight alternative to bots for one-directional automated messages. No bot token required, no 24/7 process to maintain — just HTTP POST requests that deliver messages to a channel.
Creating a Webhook
In Discord: Channel Settings → Integrations → Webhooks → New Webhook.
Copy the webhook URL — it looks like:
https://discord.com/api/webhooks/1234567890/AbCdEfGhIjK...
Basic Webhook Message (cURL)
curl -X POST \
-H "Content-Type: application/json" \
-d '{"content": "✅ Server backup completed successfully at 03:00 UTC"}' \
https://discord.com/api/webhooks/YOUR_WEBHOOK_URL
Rich Embed Messages
import requests
def send_alert(title, description, color, fields=None):
webhook_url = "https://discord.com/api/webhooks/YOUR_WEBHOOK"
data = {
"embeds": [{
"title": title,
"description": description,
"color": color, # Integer: 15548997 = red, 3066993 = green
"fields": fields or [],
"timestamp": datetime.utcnow().isoformat()
}]
}
response = requests.post(webhook_url, json=data)
return response.status_code
# VPS CPU alert
send_alert(
title="⚠️ High CPU Usage",
description="VPS CPU has exceeded 90% for 5 minutes",
color=15548997, # Red
fields=[
{"name": "Server", "value": "prod-vps-1", "inline": True},
{"name": "CPU Usage", "value": "94%", "inline": True}
]
)
Practical Automation Examples
Daily server stats:
#!/bin/bash
# cron: 0 9 * * *
PLAYERS=$(rcon_tool players | wc -l)
UPTIME=$(uptime -p)
curl -X POST -H "Content-Type: application/json" \
-d "{"content": "📊 Daily Stats: ${PLAYERS} players active | Uptime: ${UPTIME}"}" \
YOUR_WEBHOOK_URL
Game server player join notifications:
// In your game server plugin/script:
const notifyDiscord = async (playerName, action) => {
await fetch(process.env.DISCORD_WEBHOOK, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
content: `${action === 'join' ? '👋' : '👋'} **${playerName}** ${action}ed the server`
})
});
};
Rate Limiting Webhooks
Webhooks are limited to 30 messages/minute per webhook URL. For high-frequency alerts, batch them or use multiple webhooks for different severity levels.
Connect your infrastructure alerts to Discord via webhooks on Space-Node