This action has been deprecated and will no longer be available in new workflows.

Searches for messages matching a query.

To learn more, visit the Slack documentation.

Parameters

ParameterDescription
QuerySearch query.
SortReturn matches sorted by either score or timestamp.
Sort DirectionChange sort direction to ascending (asc) or descending (desc).

Example Output

{    "messages": {        "matches": [            {                "channel": {                    "id": "C12345678",                    "is_ext_shared": false,                    "is_mpim": false,                    "is_org_shared": false,                    "is_pending_ext_shared": false,                    "is_private": false,                    "is_shared": false,                    "name": "general",                    "pending_shared": []                },                "iid": "cb64bdaa-c1e8-4631-8a91-0f78080113e9",                "permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508284197000015",                "team": "T12345678",                "text": "The meaning of life the universe and everything is 42.",                "ts": "1508284197.000015",                "type": "message",                "user": "U2U85N1RV",                "username": "roach"            },            {                "channel": {                    "id": "C12345678",                    "is_ext_shared": false,                    "is_mpim": false,                    "is_org_shared": false,                    "is_pending_ext_shared": false,                    "is_private": false,                    "is_shared": false,                    "name": "random",                    "pending_shared": []                },                "iid": "9a00d3c9-bd2d-45b0-988b-6cff99ae2a90",                "permalink": "https://hitchhikers.slack.com/archives/C12345678/p1508795665000236",                "team": "T12345678",                "text": "The meaning of life the universe and everything is 101010",                "ts": "1508795665.000236",                "type": "message",                "user": "",                "username": "robot overlord"            }        ],        "pagination": {            "first": 1,            "last": 2,            "page": 1,            "page_count": 1,            "per_page": 20,            "total_count": 2        },        "paging": {            "count": 20,            "page": 1,            "pages": 1,            "total": 2        },        "total": 2    },    "ok": true,    "query": "The meaning of life the universe and everything"}

Workflow Library Example

Search Messages with Slack and Send Results Via Email

Preview this Workflow on desktop