List messages

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

GET /v1/provider/slack/messages

Addresshttps://api.hanzo.ai/v1/provider/slack/messages
MethodGET
Operationget_provider_slack_messages
AuthAuthorization: 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.

FieldInTypeRequiredDescription
channelquerystring—Channel is a Slack channel ID, name (#hanzo-gtm), or Slack channel mention.
limitqueryinteger—Limit bounds the page to 1-100 messages; zero defaults to 15.
cursorquerystring—Cursor continues the previous page's next_cursor.
thread_tsquerystring—ThreadTS reads a thread via conversations.replies.
oldestquerystring—Oldest filters to messages after this Slack timestamp (exclusive).
latestquerystring—Latest filters to messages before this Slack timestamp (exclusive).

Response

StatusBodyMeaning
200provider.slackMessagesOutok
defaultproblem-detailsrefused

200 body — 18 fields.

FieldInTypeAlwaysDescription
channelbodystring—Channel is the resolved channel ID, reusable for further reads and replies.
has_morebodyboolean—HasMore indicates that Slack has additional messages beyond this page.
messagesbodyprovider.slackMessage[]—Messages is one page, newest first for history and oldest first for threads.
messages[].bot_idbodystring—BotID identifies a bot author when present.
messages[].filesbodyprovider.slackFile[]—Files are the files attached to this message.
messages[].files[].idbodystring—ID is the file's Slack ID and the handle the file read takes.
messages[].files[].mimetypebodystring—Mimetype is the type Slack recorded at upload.
messages[].files[].namebodystring—Name is the filename as uploaded.
messages[].files[].permalinkbodystring—Permalink opens the file in Slack, for a person.
messages[].files[].sizebodyinteger (int64)—Size is the file's length in bytes.
messages[].files[].titlebodystring—Title is the title Slack displays, which may differ from the filename.
messages[].reply_countbodyinteger (int64)—ReplyCount indicates whether a parent has replies to fetch separately.
messages[].subtypebodystring—Subtype distinguishes messages from channel events.
messages[].textbodystring—Text is the message in Slack's formatting.
messages[].thread_tsbodystring—ThreadTS is the parent timestamp for a threaded message.
messages[].tsbodystring—TS is Slack's exact message timestamp and ID; retain it as a string.
messages[].userbodystring—User is the author's Slack user ID.
next_cursorbodystring—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 get
import { 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();
curl https://api.hanzo.ai/v1/provider/slack/messages \
  -H "Authorization: Bearer $HANZO_API_KEY"

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:

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 · All Hanzo APIs · Interactive reference

Was this page useful?