# Delete Bot

> Stops and removes a paper bot. Its open paper positions stay until they settle.

Source: https://rivo.markets/docs/reference/delete-bot

`DELETE /v2/bots/{id}`

Scope: `write`

This route removes a paper bot. Rivo deletes a signal or market bot. A trader bot stops copying, but you keep following the trader, and your alerts stay as they were.

Rivo does not sell the bot's open paper positions. They stay in [Get Paper Account](https://rivo.markets/docs/reference/get-paper-account) until they settle. The API refuses to delete a live bot.

## Example request

curl:

```bash
curl -X DELETE "https://api.rivo.markets/v2/bots/signal%3A2c91e7d4-5a3b-4f08-b6e2-91d04f7a3c55" \
  -H "Authorization: Bearer rivo_live_..."
```

Python:

```python
import requests

url = "https://api.rivo.markets/v2/bots/signal%3A2c91e7d4-5a3b-4f08-b6e2-91d04f7a3c55"
headers = {
    "Authorization": "Bearer rivo_live_...",
}

res = requests.delete(url, headers=headers)
res.raise_for_status()
print(res.status_code)
```

TypeScript:

```typescript
const res = await fetch("https://api.rivo.markets/v2/bots/signal%3A2c91e7d4-5a3b-4f08-b6e2-91d04f7a3c55", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.RIVO_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`Rivo API ${res.status}`);
```

## Path parameters

- `id` (string, required): The bot's id, as [List Bots](https://rivo.markets/docs/reference/list-bots) returns it: `trader:<id>`, `signal:<id>` or `market:<id>`.

## Example response

```json
{
  "data": {
    "id": "signal:2c91e7d4-5a3b-4f08-b6e2-91d04f7a3c55",
    "deleted": true
  }
}
```

## Response fields

- `data` (object): The bot that the API deleted.
  - `id` (string): The deleted bot's id.
  - `deleted` (boolean): This is always `true`.

## Errors

| Code | When |
| --- | --- |
| `SCOPE_REQUIRED` | The key does not have the `write` scope. |
| `NOT_FOUND` | No bot has that id. |
| `VALIDATION` | The bot is live. |
