Skip to content
ContractSpec
Start here

Slack Messaging

ContractSpec supports signed Slack event ingestion and outbox-backed outbound replies through the channel runtime.

Required secrets and config

// secret payload
{
  "botToken": "xoxb-...",
  "signingSecret": "..."
}

// optional connection config
{
  "defaultChannelId": "C0123456789",
  "apiBaseUrl": "https://slack.com/api"
}

Webhook ingress

  • Inbound events are accepted on/webhooks/slack/events.

  • Requests are validated with Slack signatures (x-slack-signature+ timestamp tolerance).

  • Normalized events are deduplicated and persisted before any outbound side effects.

Workspace routing and dispatch

# Workspace mapping (recommended)
CHANNEL_WORKSPACE_MAP_SLACK={"T123":"workspace-acme"}

# Dispatch protection
CHANNEL_DISPATCH_TOKEN=...

# Optional scheduler
CHANNEL_DISPATCH_INTERVAL_MS=120000
CHANNEL_DISPATCH_RUN_ON_START=1

Best practices

  • Keep bot tokens and signing secrets in a managed secret provider.

  • Use workspace mapping to prevent cross-tenant event leakage.

  • Keep dispatch asynchronous so webhook handlers stay fast and reliable.

  • Monitor telemetry for ingest, decision, outbox, and dispatch stages.