Integrations

Discord Webhooks Guide

Discord exposes two different HTTP callback protocols. Interactions deliver slash commands, components, and modal submissions. Event Webhooks deliver application authorization, entitlement, lobby, and Social SDK events. Use a separate FastHook source for each endpoint.

FastHook verifies the Ed25519 signature before returning any PING response. Interaction PING payloads use type: 1 and receive PONG JSON. Event Webhook PING payloads use type: 0 and receive an empty 204; verified events are queued and acknowledged with the same status.

Ordinary Interactions are automatically deferred with { type: 5 }, so Discord receives its initial response inside the three-second deadline. Connect an Interaction follow-up destination to send the final message with the original interaction token, which Discord keeps valid for 15 minutes.

Choose the correct FastHook resource

  • Discord Interactions source:receives slash commands, button/select interactions, and modal submissions from the application's Interactions Endpoint URL.
  • Discord Event Webhooks source:receives application, entitlement, lobby, and Social SDK events from the application's Webhook Events Endpoint URL.
  • Discord destination: sends a new channel webhook message or a follow-up response. A destination URL must never be pasted into either Discord callback endpoint field.
Keep Interactions and Event Webhooks on separate sources because their payload type values have different protocol meanings.

Discord headers

  • x-signature-ed25519: Ed25519 signature in hex.
  • x-signature-timestamp: timestamp concatenated with the raw body before verification.

Create a Discord Interactions source

Create Discord Interactions source
curl -X POST "https://api.fasthook.io/v1/sources" \
  -H "Authorization: Bearer $FASTHOOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Discord interactions production",
    "type": "DISCORD",
    "config": {
      "auth_type": "PROVIDER_SIGNATURE",
      "auth": {
        "provider": "DISCORD",
        "public_key": "hex-application-public-key"
      },
      "allowed_http_methods": ["POST"]
    }
  }'

In the Discord Developer Portal, open General Information, copy the Application Public Key into FastHook, then paste the generated FastHook Source URL into Interactions Endpoint URL. Saving the endpoint triggers Discord's signed PING check; expect a verified 200 with { type: 1 }.

No custom response is required. FastHook automatically returns a deferred response for ordinary interactions and an empty choices response for autocomplete. Use source proxy mode when autocomplete needs dynamic choices or a command needs a different immediate response. Enable Private slash-command responses on the Source when the deferred result should be visible only to the user who ran the command.

Send the slash-command follow-up

Create a Discord destination, choose Slash-command follow-up, and connect the Interaction source to it. FastHook reads the application ID and short-lived interaction token from the original, signature-verified payload. You do not paste or store that token in destination settings.

  • Message content, embeds, components/buttons, polls, file uploads, allowed mentions, and message flags are supported.
  • Username, avatar, thread_id, and thread_name are channel-webhook options and do not apply to interaction follow-ups.
  • Discord interaction tokens expire after 15 minutes; delayed deliveries after that window fail safely.
  • Files are fetched from public HTTPS URLs configured in files_template. FastHook accepts up to 10 files, 10 MiB per file, and 20 MiB per message.
  • Private follow-ups inherit the ephemeral state selected on the Discord Interactions Source.

Create a Discord Event Webhooks source

Create Discord Event Webhooks source
curl -X POST "https://api.fasthook.io/v1/sources" \
  -H "Authorization: Bearer $FASTHOOK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Discord event webhooks production",
    "type": "DISCORD_EVENTS",
    "config": {
      "auth_type": "PROVIDER_SIGNATURE",
      "auth": {
        "provider": "DISCORD_EVENTS",
        "public_key": "hex-application-public-key"
      },
      "allowed_http_methods": ["POST"]
    }
  }'

In the Discord Developer Portal, open Webhook Events, paste the generated Event Webhooks Source URL into Webhook Events Endpoint URL, enable events, and select the subscriptions you need. Expect a signed type: 0 test to receive an empty 204.

Routing strategy

  • Route command interactions to command handlers.
  • Route moderation or admin interactions to safer internal services.
  • Route application authorization and deauthorization events to installation lifecycle handlers.
  • Route entitlement events to billing or access-control workflows.
  • Keep long-running work asynchronous so Discord receives a fast accepted response path.
  • Use replay for debugging failed internal automations, not for re-running unsafe side effects blindly.

Related guides