# List messages

URL: https://docs.hanzo.ai/docs/openapi/provider/get-provider-slack-messages

> Reads recent messages from a named Slack channel such as #hanzo-gtm.

`GET /v1/provider/slack/messages`

> [Provider →](https://docs.hanzo.ai/docs/openapi/provider) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                   |
| ------------- | ------------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/provider/slack/messages` |
| **Method**    | `GET`                                             |
| **Operation** | `get_provider_slack_messages`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`            |

Reads recent messages from a named Slack channel such as
\#hanzo-gtm. The bot must be a member and have the relevant history scope.
Set thread\_ts to fetch a parent's replies, and cursor to continue a page.
Channel history is newest first; thread replies are oldest first.

## Request

6 fields.

| Field       | In    | Type    | Required | Description                                                                 |
| ----------- | ----- | ------- | -------- | --------------------------------------------------------------------------- |
| `channel`   | query | string  | —        | Channel is a Slack channel ID, name (#hanzo-gtm), or Slack channel mention. |
| `limit`     | query | integer | —        | Limit bounds the page to 1-100 messages; zero defaults to 15.               |
| `cursor`    | query | string  | —        | Cursor continues the previous page's next\_cursor.                          |
| `thread_ts` | query | string  | —        | ThreadTS reads a thread via conversations.replies.                          |
| `oldest`    | query | string  | —        | Oldest filters to messages after this Slack timestamp (exclusive).          |
| `latest`    | query | string  | —        | Latest filters to messages before this Slack timestamp (exclusive).         |

## Response

| Status    | Body                      | Meaning |
| --------- | ------------------------- | ------- |
| `200`     | provider.slackMessagesOut | ok      |
| `default` | problem-details           | refused |

`200` body — 18 fields.

| Field                          | In   | Type                     | Always | Description                                                                  |
| ------------------------------ | ---- | ------------------------ | ------ | ---------------------------------------------------------------------------- |
| `channel`                      | body | string                   | —      | Channel is the resolved channel ID, reusable for further reads and replies.  |
| `has_more`                     | body | boolean                  | —      | HasMore indicates that Slack has additional messages beyond this page.       |
| `messages`                     | body | provider.slackMessage\[] | —      | Messages is one page, newest first for history and oldest first for threads. |
| `messages[].bot_id`            | body | string                   | —      | BotID identifies a bot author when present.                                  |
| `messages[].files`             | body | provider.slackFile\[]    | —      | Files are the files attached to this message.                                |
| `messages[].files[].id`        | body | string                   | —      | ID is the file's Slack ID and the handle the file read takes.                |
| `messages[].files[].mimetype`  | body | string                   | —      | Mimetype is the type Slack recorded at upload.                               |
| `messages[].files[].name`      | body | string                   | —      | Name is the filename as uploaded.                                            |
| `messages[].files[].permalink` | body | string                   | —      | Permalink opens the file in Slack, for a person.                             |
| `messages[].files[].size`      | body | integer (int64)          | —      | Size is the file's length in bytes.                                          |
| `messages[].files[].title`     | body | string                   | —      | Title is the title Slack displays, which may differ from the filename.       |
| `messages[].reply_count`       | body | integer (int64)          | —      | ReplyCount indicates whether a parent has replies to fetch separately.       |
| `messages[].subtype`           | body | string                   | —      | Subtype distinguishes messages from channel events.                          |
| `messages[].text`              | body | string                   | —      | Text is the message in Slack's formatting.                                   |
| `messages[].thread_ts`         | body | string                   | —      | ThreadTS is the parent timestamp for a threaded message.                     |
| `messages[].ts`                | body | string                   | —      | TS is Slack's exact message timestamp and ID; retain it as a string.         |
| `messages[].user`              | body | string                   | —      | User is the author's Slack user ID.                                          |
| `next_cursor`                  | body | string                   | —      | NextCursor continues this query; never assume one page is the whole history. |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo provider slack messages get
```

**SDK**

**.ts**

```ts
import { Configuration, ProviderApi } from 'hanzoai';

const api = new ProviderApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getProviderSlackMessages();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ProviderApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ProviderApi(client).get_provider_slack_messages()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.ProviderAPI.GetProviderSlackMessages(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, provider_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = provider_api::get_provider_slack_messages(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ProviderApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new ProviderApi(client).getProviderSlackMessages();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/provider/slack/messages \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **provider** through the `provider` tool, which names its 38 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_connections"
         }
       }
     }'
```

---

[Provider API](https://docs.hanzo.ai/docs/openapi/provider) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
