> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove bot

> Removes one Typebot bot (with ?botId=) or all of them

**Auth:** `TokenAccount` or `TokenInstance` • **Rate limit:** `Global` (100/min) • **Idempotent:** yes

## Description

Removes Typebot bots from the instance and re-syncs the remaining list. Pass `?botId=` to remove a **single** bot; **without** `botId`, **all** the instance's bots are removed and the integration is disconnected. When no bot is left, the integration is deactivated and the local link is deleted.

<Warning>
  Calling `DELETE /api/typebot/delete/:instance` **without** `?botId=` removes **every** bot of the instance and disconnects the integration. Provide `?botId=` when you only want to remove one.
</Warning>

<Note>
  The re-sync is **best-effort**: if it fails, the server only logs a warning and the bot removal **remains valid** (the local rows were already deleted). That's why this endpoint does not expose integration errors in its return.
</Note>

## Example

**Remove a single bot**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://ryzeapi.cloud/api/typebot/delete/suporte?botId=8f3a1c2e-...-b7d9" \
    -H "token: $Token_Account"
  ```

  ```javascript JavaScript theme={null}
  await fetch("https://ryzeapi.cloud/api/typebot/delete/suporte?botId=8f3a1c2e-...-b7d9", {
    method: "DELETE",
    headers: {
      "token": process.env.Token_Account
    }
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.delete(
      "https://ryzeapi.cloud/api/typebot/delete/suporte",
      headers={
          "token": os.environ["Token_Account"]
      },
      params={ "botId": "8f3a1c2e-...-b7d9" }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
  )

  func main() {
      req, _ := http.NewRequest("DELETE", "https://ryzeapi.cloud/api/typebot/delete/suporte?botId=8f3a1c2e-...-b7d9", nil)
      req.Header.Set("token", os.Getenv("Token_Account"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

**Remove all bots of the instance**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://ryzeapi.cloud/api/typebot/delete/suporte" \
    -H "token: $Token_Account"
  ```

  ```javascript JavaScript theme={null}
  await fetch("https://ryzeapi.cloud/api/typebot/delete/suporte", {
    method: "DELETE",
    headers: {
      "token": process.env.Token_Account
    }
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.delete(
      "https://ryzeapi.cloud/api/typebot/delete/suporte",
      headers={
          "token": os.environ["Token_Account"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
  )

  func main() {
      req, _ := http.NewRequest("DELETE", "https://ryzeapi.cloud/api/typebot/delete/suporte", nil)
      req.Header.Set("token", os.Getenv("Token_Account"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

```json 200 OK theme={null}
{
  "success": true,
  "message": "typebot bot(s) deleted",
  "meta": { "deleted": 1 }
}
```

| Field          | Description                                                                                |
| -------------- | ------------------------------------------------------------------------------------------ |
| `success`      | Always `true` on success.                                                                  |
| `message`      | Fixed confirmation message (`typebot bot(s) deleted`).                                     |
| `meta.deleted` | Number of bots actually removed (`1` with `?botId=`, or the full count when removing all). |

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name (e.g., `suporte`).
</ParamField>

## Query parameters

<ParamField query="botId" type="string">
  UUID of a single bot to remove, obtained from [`GET /api/typebot/list/:instance`](/en/api/typebot/list). Omitted, **all** the instance's bots are removed and the integration is disconnected.
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

## Behavior

<Steps>
  <Step title="Remove the local bot(s)">
    Deletes the matching row(s) from the `typebot_bots` table. With `?botId=`, only that bot; without it, all of them.
  </Step>

  <Step title="Re-sync the remaining bots (60s timeout)">
    RyzeAPI recomputes the list of bots and (re)activates the integration. A failure here is only logged as a warning, it does not revert the removal.
  </Step>

  <Step title="Deactivate if none is left">
    When no bot remains, the integration is deactivated and the link in `typebot_integrations` is deleted.
  </Step>
</Steps>

## Errors

| HTTP | `error.message`      |
| :--: | -------------------- |
|  404 | `instance not found` |
|  404 | `bot not found`      |

## Next

<CardGroup cols={2}>
  <Card title="List bots" icon="list" href="/en/api/typebot/list">
    Check which bots are still registered on the instance.
  </Card>

  <Card title="Create bot" icon="robot" href="/en/api/typebot/set">
    Recreate or add a bot with `POST /api/typebot/set/:instance`.
  </Card>
</CardGroup>
