Inbound

Inbound Slack

@dsar/inbound-slack accepts Slack webhook deliveries and maps them into canonical DSAR request capture input. Supports messages, slash commands, shortcuts, block actions, and modal submissions.

Installation

Package managerCommand
npmnpm install @dsar/inbound-slack
pnpmpnpm add @dsar/inbound-slack
yarnyarn add @dsar/inbound-slack
bunbun add @dsar/inbound-slack

Setup

  1. Create a Slack app with the Events API enabled.
  2. Point the webhook to your DSAR endpoint: POST /webhooks/inbound/slack.
  3. Subscribe to events — app mentions, DMs, slash commands, shortcuts, block actions, or modal submissions.
  4. Install the app into the target workspace and capture the signing secret and bot token.
  5. Verify the endpoint — trigger Slack's URL verification flow and confirm the DSAR endpoint echoes the challenge response with HTTP 200.

Quickstart

Webhook endpoint: POST /webhooks/inbound/slack

Required headers: x-slack-signature, x-slack-request-timestamp

Configuration

OptionDefaultDescription
signingSecretSlack app signing secret (required)
botTokenBot token for profile lookup and Chat SDK
userNameBot username for Chat SDK adapter
replayToleranceSeconds300Maximum age for signed requests
dedupeTtlMs300000Chat SDK dedupe window
defaultRouteFallback route for unmatched events
teamRoutesRoute map keyed by Slack team ID

Supported Surfaces

  • Events API messages, app mentions, DMs, and thread replies
  • Slash commands
  • Shortcuts and message actions
  • Block actions
  • Modal submissions
  • URL verification challenge

Intake Mapping

FieldValue
intakeSource.typeslack
intakeSource.channelslack:{channelName|channelId|surface}
intakeSource.rawContextRefslack:{teamId}:{channelId}:{threadOrEvent}
intakeSource.rawTextNormalised message/command/modal text
requestor.nameSlack display name when available
requestor.emailResolved from Slack profile when botToken is configured

Idempotency

Idempotency key format: inbound-slack:{sourceId}:{tenantId}:{workspaceId|*}

URL verification returns the raw Slack challenge response and does not create a DSAR request.

Failure Modes

  • Invalid signature, stale timestamp, or malformed payloadREQUEST_VALIDATION_FAILED
  • Missing route and no default routeREQUEST_VALIDATION_FAILED
  • Non-DSAR conversational events — accepted with status: ignored_non_dsar

Related