Slack Reference

Interface parameters, endpoints, event handling, and OAuth scopes for the Slack interface.

Interface Parameters

Pass one of agent, team, or workflow to the Slack constructor.

from agno.os.interfaces.slack import Slack

Slack(agent=my_agent, streaming=True, prefix="/slack")
ParameterTypeDefaultDescription
agentOptional[Union[Agent, RemoteAgent]]NoneAgno Agent or RemoteAgent instance.
teamOptional[Union[Team, RemoteTeam]]NoneAgno Team or RemoteTeam instance.
workflowOptional[Union[Workflow, RemoteWorkflow]]NoneAgno Workflow or RemoteWorkflow instance.
prefixstr"/slack"URL prefix for Slack endpoints (e.g., /slack means events arrive at /slack/events).
tagsOptional[List[str]]NoneFastAPI route tags for API documentation. Defaults to ["Slack"].
reply_to_mentions_onlyboolTrueWhen True (default), the bot responds to @mentions in channels and all DMs. When False, responds to all channel messages.
tokenOptional[str]NoneBot token. Falls back to SLACK_TOKEN environment variable.
signing_secretOptional[str]NoneSlack app signing secret. Falls back to SLACK_SIGNING_SECRET environment variable.
streamingboolTrueEnable real-time streaming with task cards and live text updates.
loading_messagesOptional[List[str]]NoneStatus messages shown while the agent processes. Rotated automatically by Slack.
task_display_modestr"plan"How task cards render in the streaming UI. "plan" shows a collapsible plan block.
loading_textstr"Thinking..."Status text shown while the agent starts processing.
suggested_promptsOptional[List[Dict[str, str]]]NonePrompts supplied by the legacy assistant_thread_started handler; current new-app lifecycle support is limited (see Setup). Each dict has title and message keys. Defaults to Help and Search prompts.
sslOptional[SSLContext]NoneSSL context for the Slack WebClient.
buffer_sizeint100Characters to buffer before flushing a streaming update.
max_file_sizeint1073741824Maximum file size in bytes for uploads and downloads (default 1 GB).
resolve_user_identityboolFalseLook up each user's email and display name via the Slack users.info API. Uses the email as user_id when available, otherwise the Slack ID. Adds resolved profile metadata; requires profile/email scopes.
respond_to_other_appsboolFalseOpt in to eligible messages from other apps; own-bot and ignored-subtype filters still apply.
markdownboolTrueEnable Slack Markdown in supported response calls.
unfurl_linksboolTrueRequest link unfurls in message calls that accept the setting.
unfurl_mediaboolTrueRequest media unfurls in message calls that accept the setting.

New session IDs include entity_id:channel_id:thread_ts; legacy entity_id:thread_ts records can be reused. Profile resolution does not unify identities across other platforms automatically. See Identity.

The current prompt handler remains tied to assistant_thread_started; it does not initialize prompts on app_home_opened. Follow current Slack app setup and account for this adapter limitation.

Endpoints

Available at the /slack prefix (customizable with prefix).

POST {prefix}/events

Receives all Slack events (URL verification, messages, app mentions, thread starts).

StatusDescription
200Event acknowledged. Processing happens in the background so Slack gets a response within 3 seconds.
400Missing X-Slack-Request-Timestamp or X-Slack-Signature headers.
403Invalid Slack signing signature.
500SLACK_SIGNING_SECRET is not set (checked on each request, not at startup).

POST {prefix}/interactions

Handles Slack interactive components for Human-in-the-Loop (HITL) features: button clicks, form submissions, and approval/denial actions.

StatusDescription
200Interaction acknowledged. Processing happens in the background.
400Missing Slack headers or malformed payload.
403Invalid Slack signing signature.

HITL features require this endpoint. Configure Interactivity & Shortcuts in your Slack App settings and set the Request URL to {your-url}{prefix}/interactions.

Built-in Event Handling

EventBehavior
URL verificationEchoes the challenge field back to Slack during app setup.
assistant_thread_startedSets suggested_prompts on new threads (streaming mode only).
Retry deduplicationEvents with X-Slack-Retry-Num are acknowledged without reprocessing. The original event is already being processed in the background.
Bot self-loop preventionOwn-bot messages and configured ignored subtypes are dropped. Other app messages require respond_to_other_apps=True.

OAuth Scopes

Add scopes in your Slack App under OAuth & Permissions > Bot Token Scopes.

Minimum (streaming bot)

ScopeRequired For
app_mentions:readReceive @mention events in channels
assistant:writeStreaming task cards, suggested prompts, thread titles
channels:readResolve channel names and IDs (called on every inbound event)
chat:writeSend messages and stream responses
im:historyRead DM history for thread context

All five scopes above are required for a functional streaming bot. Missing app_mentions:read means the bot won't receive @mentions; missing channels:read causes channel name resolution to fail silently.

File Handling

ScopeRequired For
files:readDownload files users attach to messages
files:writeUpload images, audio, video, and files generated by agent tools

SlackTools Methods

The current Slack interface copies event.assistant_thread.action_token into run metadata. It does not read the top-level event.action_token used in Slack's current agent example. Events carrying only that top-level token reach search_workspace without the required credential and return a no-token error.

Slack's Real-time Search guide prohibits retaining data retrieved by that API. Agno's ordinary session persistence can retain raw tool results; the Slack Team interface also enables member-response storage. Configure and verify event-token handling and the complete storage path before enabling this search. The workspace-tools example keeps it disabled pending those integration changes.

ScopeRequired For
channels:readlist_channels(), get_channel_info()
channels:historyget_channel_history(), get_thread() in public channels
chat:writesend_message(), send_message_thread()
files:readdownload_file(), download_file_bytes()
files:writeupload_file()
groups:readlist_channels() for private channels
groups:historyget_channel_history(), get_thread() in private channels
search:readsearch_messages() (requires user token)
search:read.publicsearch_workspace() messages and channels
search:read.filessearch_workspace() files
search:read.userssearch_workspace() users
users:readlist_users(), get_user_info()
users:read.emailget_user_info() with email field

Feature-Specific

ScopeRequired For
users:readresolve_user_identity=True on the Slack interface
users:read.emailresolve_user_identity=True with email lookup
channels:historyreply_to_mentions_only=False in public channels
groups:historyreply_to_mentions_only=False in private channels

Event Subscriptions

Subscribe to events under Event Subscriptions > Subscribe to bot events.

EventRequired For
app_mentionRespond to @mentions in channels
message.imRespond to direct messages
assistant_thread_startedLegacy prompt initialization; see the setup limitation
message.channelsRespond to all public channel messages (reply_to_mentions_only=False)
message.groupsRespond to all private channel messages (reply_to_mentions_only=False)

Developer Resources