Skip to content

Slack Events API

Slack’s Events API delivers JSON over HTTPS and requires a URL verification handshake before events flow. HookNexus can receive both the challenge and subsequent event deliveries so you can inspect payloads and headers in one place.

How Slack talks to your endpoint

  1. URL verification — Slack sends url_verification with a challenge string; your endpoint must echo challenge in JSON.
  2. Events — After verification, Slack POSTs event envelopes (e.g. event_callback) signed with X-Slack-Signature.

Setup in Slack

  1. Create or open a Slack app

    Go to api.slack.com/apps, select your app (or create one).

  2. Enable Event Subscriptions

    In the app settings, open Event Subscriptions and turn Enable Events on.

  3. Set the Request URL

    Enter your HookNexus webhook URL:

    https://api.hooknexus.com/h/YOUR_ENDPOINT_ID
  4. Complete URL verification

    Slack sends a url_verification event. Your endpoint must respond with JSON {"challenge":"<value>"}.

    If verification stays pending, use a temporary handler that returns the challenge, or verify manually by inspecting the captured request in HookNexus and understanding what Slack expects—then switch to an app URL that responds correctly.

  5. Subscribe to bot/user events

    Under Subscribe to bot events, add events such as message.channels, app_mention, or reaction_added (depending on scopes).

  6. Reinstall the app if scopes changed

    After changing scopes, reinstall the app to your workspace from Install App.

Signature verification

Each request includes:

HeaderPurpose
X-Slack-Signaturev0=<hex hmac>
X-Slack-Request-TimestampUnix seconds; used in the signed base string

The signed payload format is: v0:{timestamp}:{raw_body}

Use HookNexus Verify Signature with provider Slack and your app’s Signing Secret from Basic InformationApp Credentials.

Terminal window
curl -X POST https://api.hooknexus.com/api/verify-signature \
-H "Content-Type: application/json" \
-d '{
"provider": "slack",
"payload": "<raw body>",
"signature": "v0=...",
"secret": "your_signing_secret",
"timestamp": "<X-Slack-Request-Timestamp>"
}'

The timestamp field must match X-Slack-Request-Timestamp—it is part of the signed base string v0:{timestamp}:{body}.

Common events

Event / patternUse case
messageChannel messages (with appropriate scopes)
app_mentionBot responds when @mentioned
reaction_addedEmoji reactions on messages

Event names appear inside the JSON envelope (event.type).

Troubleshooting

SymptomWhat to check
Request URL never verifiesResponse must be 200 with correct JSON challenge; Slack expects a response within a few seconds.
No events after verifyConfirm events are subscribed and bot is in the channel (for channel messages).
Invalid signatureUse Signing Secret from the same app; raw body must match Slack’s bytes.
Duplicate eventsSlack retries on timeouts; use event_id for deduplication in your app.

Consider Socket Mode for local dev without a public URL; use HookNexus when you want HTTP capture of the same event shapes.