Message a bot, or stop it, by naming the action in the path
Dispatches one verb against a bot the caller's org owns.
POST /v1/visor/compute/bots/{id}/{action}
| Address | https://api.hanzo.ai/v1/visor/compute/bots/{id}/{action} |
| Method | POST |
| Operation | post_visor_compute_bots_by_id_by_action |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Dispatches one verb against a bot the caller's org owns. message runs the bot's bound agent with the request body as the message and streams the agent's answer back VERBATIM — the upstream body, its content type and its status — so a message is a real agent run, recorded, billed and traced exactly like any other, under the caller's own identity rather than a fabricated one. stop and pause are the same single honest capability: they halt the runtime by unbinding the agent while LEAVING THE MACHINE UP, so the bot stops answering but keeps costing — rebind to resume, or delete the bot to tear it down. Stopping is idempotent; a bot with no binding still reports stopped.
Org-scoped and fails closed: a validated principal is required (403 without one) and the bot is addressed under the caller's OWN org, so another tenant's id is not reachable. An unknown action is a clean 400 naming the three it accepts, never a silent no-op, and messaging a bot with no bound agent is a 400.
Request
2 fields.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
action | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, VisorApi } from 'hanzoai';
const api = new VisorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postVisorComputeBotsByIdByAction({ id: 'id', action: 'action' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import VisorApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = VisorApi(client).post_visor_compute_bots_by_id_by_action(id='id', action='action')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.VisorAPI.PostVisorComputeBotsByIdByAction(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, visor_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = visor_api::post_visor_compute_bots_by_id_by_action(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.VisorApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new VisorApi(client).postVisorComputeBotsByIdByAction();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were 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 -X POST https://api.hanzo.ai/v1/visor/compute/bots/<id>/<action> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches visor through the visor tool, which names its 34 operations with its own verbs — this one among them, under a name only the door 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_compute_regions"
}
}
}'How is this guide?