Receive and verify Discord webhook events. Use when setting up Discord webhook handlers, debugging Ed25519 signature verification, handling PING endpoint validation, or processing events like APPLICATION_AUTHORIZED, ENTITLEMENT_CREATE, or LOBBY_MESSAGE_CREATE.
Receive and verify Discord webhook events. Use when setting up Discord webhook handlers, debugging Ed25519 signature verification, handling PING endpoint validation, or processing events like APPLICATION_AUTHORIZED, ENTITLEMENT_CREATE, or LOBBY_MESSAGE_CREATE.
Setting up Discord webhook event handlers (outgoing webhooks)
Verifying Discord Ed25519 signatures with X-Signature-Ed25519 and X-Signature-Timestamp
Handling the PING (type 0) endpoint validation request
Handling events like APPLICATION_AUTHORIZED, APPLICATION_DEAUTHORIZED, ENTITLEMENT_CREATE, LOBBY_MESSAGE_CREATE, GAME_DIRECT_MESSAGE_CREATE, QUEST_USER_ENROLLMENT
Debugging "invalid request signature" errors when registering your webhook endpoint
Note: This skill covers outgoing webhooks (Discord → your server) — the same Ed25519 signing scheme is shared with Interactions endpoints. Incoming webhooks (your server → Discord channel via webhook URL) are not signed and not covered here.
Essential Code (USE THIS)
Discord uses (not HMAC). The signed content is the raw concatenation . Verification uses your application's (hex-encoded), available in the Discord Developer Portal.
# Application Public Key (hex) from Discord Developer Portal → General Information
DISCORD_PUBLIC_KEY=abc123def456...
PING Validation
When you register your webhook URL in the Discord Developer Portal, Discord sends a type: 0 PING request. Your endpoint must verify the signature and respond with a 2XX status (the docs recommend 204 with empty body). Endpoint registration fails until your handler does this correctly.
We recommend installing the webhook-handler-patterns skill alongside this one for handler sequence, idempotency, error handling, and retry logic. Key references (open on GitHub):
Handler sequence — Verify first, parse second, handle idempotently third
hookdeck-event-gateway - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers