# Stop runs

URL: https://docs.hanzo.ai/docs/openapi/bot/post-bot-runs-by-runid-stop

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

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

> [Bot →](https://docs.hanzo.ai/docs/openapi/bot) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                 |
| ------------- | ----------------------------------------------- |
| **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`          |

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      | RunID is the run to stop, as the bot runtime named it. |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | bot.BotStopped  | ok      |
| `default` | problem-details | refused |

`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](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo bot runs stop <runId>
```

**SDK**

**.ts**

```ts
import { Configuration, BotApi } from 'hanzoai';

const api = new BotApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postBotRunsByRunidStop({ runId: 'runId' });
```

**.py**

```python
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')
```

**.go**

```go
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
}
```

**.rs**

```rust
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?;
```

**.java**

```java
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();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/bot/runs/<runId>/stop \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/bot) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
