Skip to main content

Slack Adapter

Requires pip install agentix[gateway-slack].

Programmatic setup

from agentix.gateway import AgentixGateway
from agentix.gateway.adapters.slack import SlackAdapter

gateway = AgentixGateway(options)

gateway.add_channel(
SlackAdapter(
bot_token="xoxb-...", # Slack Bot Token
signing_secret="...", # Slack Signing Secret (for request verification)
app_token=None, # optional: for Socket Mode
)
)

YAML config

channels:
slack:
type: slack
bot_token: "${SLACK_BOT_TOKEN}"
signing_secret: "${SLACK_SIGNING_SECRET}"

Slack app setup

  1. Create a Slack app at https://api.slack.com/apps
  2. Add Bot Token Scopes: chat:write, im:history, im:read, channels:history
  3. Enable Event Subscriptions → subscribe to message.im and message.channels
  4. Set Request URL to https://your-gateway-host/slack/events
  5. Install the app to your workspace

Webhook endpoint

The adapter registers POST /slack/events on the gateway server.

Session mapping

Each Slack user ID maps to a dedicated agent session. Sessions persist for session_ttl seconds after the last message.