Skip to main content

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[Agent]NoneAgno Agent instance.
teamOptional[Team]NoneAgno Team instance.
workflowOptional[Workflow]NoneAgno Workflow 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 shown when a user opens a new thread. 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. When enabled, the agent receives the user’s email as user_id instead of their Slack ID, and metadata includes user_name and user_email.

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).

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 preventionEvents with bot_id or subtypes bot_message, message_changed, message_deleted, and other bot lifecycle events are ignored.

Developer Resources

Slack Guide

Setup, code examples, streaming behavior, and troubleshooting.

SlackTools Reference

Toolkit parameters and methods for sending messages, searching, and file management.