> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Messages

> [!WARNING]
>
> This action has been deprecated and will no longer be available in new workflows.

Searches for messages matching a query.

> [!NOTE]
>
> External Documentation
>
> To learn more, visit the [Slack documentation](https://api.slack.com/methods/search.messages).

## Parameters

| Parameter | Description |
| - | - |
| Query | Search query. |
| Sort | Return matches sorted by either `score` or `timestamp`. |
| Sort Direction | Change sort direction to ascending (`asc`) or descending (`desc`). |

## Example Output

```json theme={"dark"}
{
	"ok": true,
	"query": "<string>",
	"messages": {
		"total": 1,
		"pagination": {
			"total_count": 0,
			"page": 2,
			"per_page": 23,
			"page_count": 1,
			"first": 1,
			"last": 2
		},
		"paging": {
			"count": 24,
			"total": 2,
			"page": 2,
			"pages": 2
		},
		"matches": [
			{
				"iid": "<string>",
				"team": "<string>",
				"score": 29,
				"channel": {
					"id": "<string>",
					"is_channel": true,
					"is_group": false,
					"is_im": false,
					"is_mpim": false,
					"is_shared": true,
					"is_org_shared": false,
					"is_ext_shared": true,
					"is_private": true,
					"name": "<string>",
					"pending_shared": [],
					"is_pending_ext_shared": false
				},
				"type": "<string>",
				"user": "<string>",
				"username": "<string>",
				"ts": "<string>",
				"blocks": [
					{
						"type": "<string>",
						"block_id": "<string>",
						"text": {
							"type": "<string>",
							"text": "<string>",
							"verbatim": false
						}
					},
					{
						"type": "<string>",
						"block_id": "<string>",
						"elements": [
							{
								"type": "<string>",
								"image_url": "<string>",
								"alt_text": "<string>"
							},
							{
								"type": "<string>",
								"text": "<string>",
								"verbatim": false
							}
						]
					}
				],
				"text": "<string>",
				"permalink": "<string>",
				"no_reactions": true
			}
		]
	}
}
```

## Workflow Library Example

[Search Messages with Slack and Send Results Via Email](https://library.blinkops.com/workflows/search-messages-with-slack-and-send-results-via-email)

![Workflow Library](https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max\&auto=format\&n=ojHYuDeYX5FWuN8a\&q=85\&s=b8af968e71438a9499c3223c9bd29fb2)

Preview this Workflow on desktop

[https://library.blinkops.com/workflows/search-messages-with-slack-and-send-results-via-email/canvas](https://library.blinkops.com/workflows/search-messages-with-slack-and-send-results-via-email/canvas)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.