Stop runs

Terminates one of the caller org's own bot runs and reports its terminal state.

POST /v1/bot/runs/{runId}/stop

Addresshttps://api.hanzo.ai/v1/bot/runs/{runId}/stop
MethodPOST
Operationpost_bot_runs_by_runid_stop
AuthAuthorization: Bearer $HANZO_API_KEY

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.

FieldInTypeRequiredDescription
runIdpathstringyesRunID is the run to stop, as the bot runtime named it.

Response

StatusBodyMeaning
200bot.BotStoppedok
defaultproblem-detailsrefused

200 body — 2 fields.

FieldInTypeAlwaysDescription
runIdbodystring—RunID is the run that was stopped.
statusbodystring—Status is the run's terminal state: "stopped".

Failure carries the platform error shape — see Errors.

Examples

hanzo bot runs stop <runId>
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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BotAPI.PostBotRunsByRunidStop(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new BotApi(client).postBotRunsByRunidStop();
curl -X POST https://api.hanzo.ai/v1/bot/runs/<runId>/stop \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches bot through the bot tool, which names its 3 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_bot_members"
         }
       }
     }'

Bot API · All Hanzo APIs · Interactive reference

Was this page useful?