Search chat messages
POST/chat.search
Full-text search over the caller's accessible messages. Returns
full-fidelity messages — text, items, voice, polls, blocks, and
mentions — hydrated through the same pipeline as
/chat.history.
All fields are optional. With no parameters, the most recent messages across all chat types (DMs, multi-DMs, group chats) are returned in reverse chronological order.
Sort: When omitted and query is empty, results are sorted
chronologically (newest first), since relevance scoring is meaningless
without search terms. Pass sort: recent to force chronological order
even with a text query.
Date filters: before and after accept YYYY-MM-DD. Dates are
interpreted in the caller's timezone (see
Timezone handling).
Access: Organization and Personal.
- Personal tokens search chats the owner can read, including public groups in their roam they have not joined.
- Organization tokens search chats the bot is a member of,
plus unjoined public groups in the bot's roam (Slack
search:read.public). Private groups the bot is not in are excluded./chat.historystays membership-only.
Required scope: chat:history
Every returned sender includes userId plus userType. The ID resolves
through user.info with the same credentials.
OpenAPI Spec: chat-v1.json
Request
Responses
- 200
- 400
- 401
- 403
- 405
- 500
Search results.
Bad request. Common causes:
- Invalid
chatTypesvalue - Invalid
excludeChatIdsorexcludeUserIds(must be UUIDs) - Invalid
before/afterdate format - Invalid
from/withemail addresses - Invalid
sortvalue
Presented invalid authentication credentials.
Forbidden. The token lacks the required scope.
An unsupported method was requested.
An internal error occurred, including a stored sender that cannot resolve as a visible principal. The endpoint does not return a partial page.