List messages
Returns the tail of one room's conversation, oldest first, each message with its reactions, files and thread count.
GET /v1/team/rooms/{id}/messages
| Address | https://api.hanzo.ai/v1/team/rooms/{id}/messages |
| Method | GET |
| Operation | get_team_rooms_by_id_messages |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns the tail of one room's conversation, oldest first, each message with its reactions, files and thread count.
It reads the SAME Chunter documents the transactor serves, so a message typed in the Team client is here with no sync. A team member reads any room they may see; an application of the org reads public channels only; anybody else without a team session is 401. A room the caller may not read answers 404 rather than 403, so a probe learns nothing about what exists.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the room, from the path. |
space | query | string | — | Space names the space holding the room, and is required for the reason the bind op requires it: a room id is unique within a space and not across the org, so searching every space for a match would make the answer depend on iteration order. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | team.teamMessages | ok |
default | problem-details | refused |
200 body — 22 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
messages | body | team.teamMessage[] | — | Messages are the conversation's, oldest first, at most messageMax of them. |
messages[].author | body | string | — | Author is the team account uuid that wrote it. |
messages[].createdOn | body | integer (int64) | — | CreatedOn is unix MILLIseconds, which is what the platform stamps. |
messages[].doc | body | string | — | Doc is the document this message is a comment on. |
messages[].editedOn | body | integer (int64) | — | EditedOn is when the author last edited the message, unix milliseconds. |
messages[].files | body | team.teamFile[] | — | Files are the files attached to the message. |
messages[].files[].file | body | string | — | File is the blob id, readable at GET /v1/team/files/{space}/{name}?file={file}. |
messages[].files[].id | body | string | — | ID is the attachment document's own id. |
messages[].files[].name | body | string | — | Name is the file's name as the person uploaded it. |
messages[].files[].size | body | integer (int64) | — | Size is the file's length in bytes, as the uploader stated it. |
messages[].files[].type | body | string | — | Type is the media type the uploader declared. |
messages[].id | body | string | — | ID is the message document's own id. |
messages[].lastReply | body | integer (int64) | — | LastReply is when the thread was last answered, unix milliseconds. |
messages[].mentions | body | string[] | — | Mentions are the account uuids the message @-mentions — exactly the people notify.go told they were mentioned. |
messages[].reactions | body | team.teamReaction[] | — | Reactions are the emoji people reacted with, one entry per emoji, in the order each emoji was first used. |
messages[].reactions[].accounts | body | string[] | — | Accounts are the account uuids that reacted with it, earliest first. |
messages[].reactions[].count | body | integer (int64) | — | Count is how many people reacted with it. |
messages[].reactions[].emoji | body | string | — | Emoji is the reaction itself, as the person picked it. |
messages[].replies | body | integer (int64) | — | Replies is how many replies the message's thread holds. |
messages[].room | body | string | — | Room is the room it was said in — the same id the room listing answers with, so a caller holding a message can name its room without a second read. |
messages[].text | body | string | — | Text is the message as PLAIN TEXT. |
messages[].thread | body | string | — | Thread is the message this one replies to. |
Failure carries the platform error shape — see Errors.
Examples
hanzo team rooms messages get <id>import { Configuration, TeamApi } from 'hanzoai';
const api = new TeamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getTeamRoomsByIdMessages({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TeamApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TeamApi(client).get_team_rooms_by_id_messages(id='id')cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.TeamAPI.GetTeamRoomsByIdMessages(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, team_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = team_api::get_team_rooms_by_id_messages(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TeamApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new TeamApi(client).getTeamRoomsByIdMessages();curl https://api.hanzo.ai/v1/team/rooms/<id>/messages \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches team through the team tool, which names its 33 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_team_account_providers"
}
}
}'