Slack
Source: https://docs.datzi.ai/channels/slackSlack
Status: production-ready for DMs + channels via Slack app integrations. Default mode is Socket Mode; HTTP Events API mode is also supported.Quick setup
- Socket Mode (default)
- HTTP Events API mode
Create Slack app and tokens
In Slack app settings:
- enable Socket Mode
- create App Token (
xapp-...) withconnections:write - install app and copy Bot Token (
xoxb-...)
Subscribe app events
Subscribe bot events for:
app_mentionmessage.channels,message.groups,message.im,message.mpimreaction_added,reaction_removedmember_joined_channel,member_left_channelchannel_renamepin_added,pin_removed
Token model
botToken+appTokenare required for Socket Mode.- HTTP mode requires
botToken+signingSecret. - Config tokens override env fallback.
SLACK_BOT_TOKEN/SLACK_APP_TOKENenv fallback applies only to the default account.userToken(xoxp-...) is config-only (no env fallback) and defaults to read-only behavior (userTokenReadOnly: true).- Optional: add
chat:write.customizeif you want outgoing messages to use the active agent identity (customusernameand icon).icon_emojiuses:emoji_name:syntax.
Access control and routing
channels.slack.dmPolicy controls DM access (legacy: channels.slack.dm.policy):
pairing(default)allowlistopen(requireschannels.slack.allowFromto include"*"; legacy:channels.slack.dm.allowFrom)disabled
channels.slack.groupPolicy controls channel handling:
openallowlistdisabled
channels.slack.channels.
Channel messages are mention-gated by default.
Mention sources:
- explicit app mention (
<@botId>) - mention regex patterns (
agents.list[].groupChat.mentionPatterns, fallbackmessages.groupChat.mentionPatterns) - implicit reply-to-bot thread behavior
channels.slack.channels.<id|name>):
requireMentionusers(allowlist)allowBotsskillssystemPrompttools,toolsBySender
Commands and slash behavior
- Native command auto-mode is off for Slack (
commands.native: "auto"does not enable Slack native commands). - Enable native Slack command handlers with
channels.slack.commands.native: true(or globalcommands.native: true). - When native commands are enabled, register matching slash commands in Slack (
/<command>names). - If native commands are not enabled, you can run a single configured slash command via
channels.slack.slashCommand.
enabled: falsename: "datzi"sessionPrefix: "slack:slash"ephemeral: true
Threading, sessions, and reply tags
- DMs route as
direct; channels aschannel; MPIMs asgroup. - With default
session.dmScope=main, Slack DMs collapse to agent main session. - Channel sessions:
agent:<agentId>:slack:channel:<channelId>. - Thread replies can create thread session suffixes (
:thread:<threadTs>) when applicable.
channels.slack.replyToMode:off|first|all(defaultoff)channels.slack.replyToModeByChatType: perdirect|group|channel
[[reply_to_current]][[reply_to:<id>]]
Media, chunking, and delivery
- text chunks use
channels.slack.textChunkLimit(default 4000) channels.slack.chunkMode="newline"enables paragraph-first splitting- file sends use Slack upload APIs and can include thread replies (
thread_ts) - outbound media cap follows
channels.slack.mediaMaxMbwhen configured
user:<id>for DMschannel:<id>for channels
Actions and gates
Slack actions are controlled bychannels.slack.actions.*.
Available action groups in current Slack tooling:
| Group | Default |
|---|---|
| messages | enabled |
| reactions | enabled |
| pins | enabled |
| memberInfo | enabled |
| emojiList | enabled |
Events and operational behavior
- Message edits/deletes/thread broadcasts are mapped into system events.
- Reaction add/remove events are mapped into system events.
- Member join/leave, channel created/renamed, and pin add/remove events are mapped into system events.
- Block actions and modal interactions emit structured
Slack interaction: ...system events.
Ack reactions
ackReaction sends an acknowledgement emoji while Datzi is processing an inbound message.
Resolution order:
channels.slack.accounts.<accountId>.ackReactionchannels.slack.ackReactionmessages.ackReaction- agent identity emoji fallback (
agents.list[].identity.emoji, else βπβ)
- Slack expects shortcodes (for example
"eyes"). - Use
""to disable the reaction for a channel or account.
Manifest and scope checklist
Troubleshooting
- No replies in channels: check
groupPolicy, channel allowlist,requireMention, per-channelusersallowlist. - DM messages ignored: check
channels.slack.dm.enabled,channels.slack.dmPolicy, pairing approvals. - Socket mode not connecting: validate bot + app tokens and Socket Mode enablement in Slack app settings.
- HTTP mode not receiving events: validate signing secret, webhook path, and Slack Request URLs.
- Native/slash commands not firing: verify
channels.slack.commands.native: trueand matching slash commands registered in Slack.
Text streaming
Datzi supports Slack native text streaming via the Agents and AI Apps API.channels.slack.streaming controls live preview behavior:
off: disable live preview streaming.partial(default): replace preview text with the latest partial output.block: append chunked preview updates.progress: show progress status text while generating, then send final text.
channels.slack.nativeStreaming controls Slackβs native streaming API (chat.startStream / chat.appendStream /
chat.stopStream) when streaming is partial (default: true).
Disable native Slack streaming (keep draft preview behavior):
Requirements
- Enable Agents and AI Apps in your Slack app settings.
- Ensure the app has the
assistant:writescope. - A reply thread must be available for that message.
