Integrations

Discord Interactions Integration Guide

Discord Interactions deliver slash commands, components, autocomplete requests, and modal submissions to an application's Interactions Endpoint URL. This guide focuses on that command-and-response workflow: signed ingress, PING/PONG validation, deferred acknowledgements, and follow-up messages.

Discord Event Webhooks are a different callback protocol for application lifecycle, entitlement, lobby, and Social SDK notifications. Configure those separately with the Discord Event source configuration reference.

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 Action: sends a new channel webhook message or a follow-up response. A Discord channel webhook URL must never be pasted into either Discord callback endpoint field.
Discord Interactions use their own signed request and response contract. Keep them separate from Discord Event sources.

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 Action, 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 Action 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.

When you need Discord Event sources

Do not reuse an Interactions source for application lifecycle or entitlement notifications. Event sources use different payload type values and acknowledge a signed endpoint test with 204. Follow the Discord Event source setup reference for the exact source type, public-key field, endpoint location, and subscription checklist.

Routing strategy

  • Route command interactions to command handlers.
  • Route moderation or admin interactions to safer internal services.
  • Route autocomplete interactions to a proxy when choices must be generated dynamically.
  • Route final command results through a slash-command follow-up Action.
  • 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