Slack Search
Reference for Slack search features and modifiers.
Important: GUI vs API Syntax Differences
When using Slack search through different interfaces, the syntax differs:
Channel References (in:)
GUI (Slack app):
- •Channels (public/private):
in:#team-marketing(with#prefix) - •DMs:
in:@username
API/MCP:
- •Channels (public/private):
in:team-marketingorin:channel_id(without#prefix) - •DMs:
in:<@UserID>(User ID wrapped in<@>)
User References (from:, with:)
- •GUI (Slack app): Use
from:@usernameorfrom:@display_name - •API/MCP: Usually
from:@usernameworks, but if it doesn't, usefrom:<@UserID>(User ID wrapped in<@>)
How to Get Channel ID
Via GUI (Browser):
- •Open Slack in your web browser
- •Select the channel from the left-hand menu
- •Click "View channel details"
- •The channel ID is at the bottom
- •Click "Copy channel ID"
Via API:
Use the conversations.list API method to retrieve all channels in the workspace, then search for the Channel ID by channel name.
How to Get User ID
Via GUI:
- •Click on the member's profile icon
- •Click "More" (three dots
...) - •Click "Copy member ID"
Via API:
Use the users.list API method to retrieve all users in the workspace, then search for the User ID by display name or username.
Search Modifiers List
| Modifier | Description | Example (GUI) | Example (API/MCP) |
|---|---|---|---|
"phrase" | Search for a specific phrase | "marketing report" | "marketing report" |
-word | Exclude a specific word | marketing -report | marketing -report |
in: | Search within a specific channel/DM | in:#team-marketing | in:team-marketing |
from: | Search for messages from a specific member | from:@username | from:@username |
has: | Messages with a specific emoji reaction | has::eyes: | has::eyes: |
hasmy: | Messages you reacted to | hasmy::thumbsup: | hasmy::thumbsup: |
is:saved | Items added to bookmarks | is:saved | is:saved |
has:pin | Pinned items | has:pin | has:pin |
before: | Before a specified date | before:2024-01-01 | before:2024-01-01 |
after: | After a specified date | after:2024-01-01 | after:2024-01-01 |
on: | On a specified date | on:2024-01-15 | on:2024-01-15 |
during: | During a specified month/year | during:January or during:2024 | during:January or during:2024 |
is:thread | Search within threads | is:thread | is:thread |
with: | Search within threads/DMs with a specific member | with:@username | with:@username |
creator: | Search for canvases created by a specific user | creator:@username | creator:@username |
-in: | Exclude a specific channel | -in:#random | -in:random |
-from: | Exclude a specific member | -from:@bot | -from:@bot |
word* | Wildcard - See results that begin with a partial word. Add an asterisk to a partial word with at least three characters to see results that begin with those specific letters. | rep* → reply, report | rep* → reply, report |
Combination Examples
GUI Examples
code
# Search for messages from a specific member in a channel marketing report in:#team-marketing from:@tanaka # Search for threads within a specific time period project is:thread after:2024-01-01 before:2024-03-01 # Bookmarked items you reacted to is:saved hasmy::star: # Search excluding specific channels API specification -in:#general -in:#random
API/MCP Examples
code
# Search for messages from a specific member in a channel marketing report in:team-marketing from:@tanaka # Search for threads within a specific time period project is:thread after:2024-01-01 before:2024-03-01 # Bookmarked items you reacted to is:saved hasmy::star: # Search excluding specific channels API specification -in:general -in:random