Create messages
Says one thing in a room, as the caller. The write goes through the SAME applyTx path the Team client's own messages take and is broadcast to every…
POST /v1/team/rooms/{id}/messages
| Address | https://api.hanzo.ai/v1/team/rooms/{id}/messages |
| Method | POST |
| Operation | post_team_rooms_by_id_messages |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Says one thing in a room, as the caller.
The write goes through the SAME applyTx path the Team client's own messages take and is broadcast to every connected client of the space, so a message sent here appears live in an open room rather than on the next reload. It answers the message as the store now HOLDS it.
Request
4 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the room to say it in, from the path. |
id | body | string | — | ID is the room to say it in, from the path. |
space | body | string | — | Space names the space holding the room. |
text | body | string | — | Text is what to say, as plain text. |
Response
| Status | Body | Meaning |
|---|---|---|
201 | team.teamMessage | created |
default | problem-details | refused |
201 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
author | body | string | — | Author is the team account uuid that wrote it. |
createdOn | body | integer (int64) | — | CreatedOn is unix MILLIseconds, which is what the platform stamps. |
id | body | string | — | ID is the message document's own id. |
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. |
text | body | string | — | Text is the message as PLAIN TEXT. The document stores markup; this is the same plainText reduction the agent responder reads a prompt with, so a caller… |
Failure carries the platform error shape — see Errors.
Examples
hanzo team rooms messages create <id>import { Configuration, TeamApi } from 'hanzoai';
const api = new TeamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTeamRoomsByIdMessages({ id: 'id', id: "<id>", space: "<space>" });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).post_team_rooms_by_id_messages(id='id', id="<id>", space="<space>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.TeamAPI.PostTeamRoomsByIdMessages(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::post_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).postTeamRoomsByIdMessages();curl -X POST https://api.hanzo.ai/v1/team/rooms/<id>/messages \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>",
"space": "<space>"
}'MCP reaches team through the team tool, which names its 18 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": "get_collaborator"
}
}
}'How is this guide?