List messages
Reads recent messages from a named Slack channel such as #hanzo-gtm. The bot must be a member and have the relevant history scope.
GET /v1/provider/slack/messages
| 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.
Examples
hanzo provider slack messages getimport { Configuration, ProviderApi } from 'hanzoai';
const api = new ProviderApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getProviderSlackMessages();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()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
}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?;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();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/provider/slack/messages \
-H "Authorization: Bearer $HANZO_API_KEY"MCP declares no tool for provider — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
How is this guide?