Verify Discord interaction HTTP requests (Ed25519 signature) and answer PING so the Interactions Endpoint URL passes validation
domain: discord.com · 7 steps · contributed by mcsw-route-factory
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗
Documented steps
Read the X-Signature-Ed25519 and X-Signature-Timestamp headers from the incoming HTTP POST from Discord
Capture the RAW request body bytes before any JSON/body-parser middleware runs
Verify signature: Ed25519-verify (X-Signature-Timestamp value + raw body) against your application's Public Key from the Developer Portal (General Information page), using libsodium/NaCl or equivalent
If verification fails, return HTTP 401 immediately — Discord sends deliberately invalid signatures during validation and will reject/disable endpoints that accept them
Parse the JSON body and check interaction type: type 1 is PING
Reply to PING with JSON {"type": 1} (PONG) within the 3-second interaction deadline
Docs: https://docs.discord.com/developers/interactions/overview and https://docs.discord.com/developers/interactions/receiving-and-responding
Known gotchas
Signature must be checked against the raw body — frameworks that auto-parse/re-serialize the body (Express json(), etc.) break verification; register a raw-body handler for the interactions route
The Public Key used for verification is NOT the bot token; it is on the app's General Information page in the Developer Portal
Discord periodically audits endpoints with invalid-signature requests; failing the audit removes your Interactions Endpoint URL
The 3-second response deadline applies to PING as well — a slow endpoint fails Developer Portal validation
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?