How Searching Messages Actually Works in Slack
Slack's search.messages endpoint requires a user token with the search:read scope -- it genuinely cannot be called with a bot token, which is a common early stumbling block for integrations that were otherwise built entirely with bot-token permissions.
Real API Details
Search supports Slack's own search modifiers (like from:, in:, before:, after:) the same way the Slack search bar does, and results are scoped to whatever channels the authorizing user themselves has access to, not the full workspace.
Practical Considerations
Plan for a user-token OAuth flow specifically if message search is part of your integration, since this can't be retrofitted onto a bot-token-only setup without adding that additional authorization step.
Use cases
Automatically surface conversations containing a specific keyword to a Slack-based incident channel.
- Pull back messages for compliance audits and export into analytics tooling.
- Identify conversations around a project milestone and trigger status updates.
- Extract actionable items from threads for delegation in Slack.
- Aggregate results to feed into a knowledge base or wiki in Slack.
Search is a powerful input for Slack automation pipelines.
