Stop terminates one of the caller org's own bot runs and reports its terminal…
Stop terminates one of the caller org's own bot runs and reports its terminal state.
POST /v1/bot/runs/{runId}/stop
| Address | https://api.hanzo.ai/v1/bot/runs/{runId}/stop |
| Method | POST |
| Operation | post_bot_runs_by_runid_stop |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Stop terminates one of the caller org's own bot runs and reports its terminal state.
The own-key guard is the org: it is the caller's validated org, never theirs to choose, and the runtime resolves the run id UNDER it. A run belonging to another tenant is not among this org's runs, so it answers absent — the same 404 a nonexistent id gets, which is what keeps this from being an oracle.
Absence is honoured ONLY when the runtime answers it. A runtime that does not serve stop reports nothing about the run, and reporting "stopped" on that basis would be a stop that cannot fail — so it is a 502.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
runId | path | string | yes |
Response
| Status | Body | Meaning |
|---|---|---|
200 | BotStopped | ok |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
runId | body | string | — | RunID is the run that was stopped. |
status | body | string | — | Status is the run's terminal state: "stopped". |
Failure carries the platform error shape — 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, BotApi } from 'hanzoai';
const api = new BotApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postBotRunsByRunidStop({ runId: 'runId' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BotApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BotApi(client).post_bot_runs_by_runid_stop(run_id='runId')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.BotAPI.PostBotRunsByRunidStop(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, bot_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = bot_api::post_bot_runs_by_runid_stop(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BotApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new BotApi(client).postBotRunsByRunidStop();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/bot/runs/<runId>/stop \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches bot through the bot tool, which names its 4 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": "get_bot_connect"
}
}
}'How is this guide?