Skip to main content

Disable Bot

info

Advanced API is available in the Business Plan

Disable a specific bot using its botId. This endpoint allows the customer to disable a bot programmatically. Once disabled, the bot will not perform any of its automated tasks until re-enabled.


POST
https://api.deadsimplechat.com/consumer/api/v2/bot/:botId/disable?auth=<YOUR_API_KEY>

Request

POST /consumer/api/v2/bot/:botId/disable

URL Parameters

ParameterDescriptionData Type
botIdThe ID of the bot to disableString

Query Parameters

ParameterDescriptionData TypeRequired
authGo to Dashboard -> Developer -> Private Key is your authStringYes

Responses

Success Response

A JSON object containing the following fields:

FieldDescriptionData Type
successIndicates the success flagBoolean
botThe disabled bot objectObject (BotModel)

HTTP Status: 200 OK

Body:

{
"success": true,
"bot": { /* Bot object data */ }
}

Error Responses

  • Bot Not Found or Unauthorized:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "success": false,
    "message": "bot not found, or customer does not have permission to modify the bot"
    }
  • General Error:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "<error_message>"
    }

Code Examples

curl

curl -X POST "https://api.deadsimplechat.com/consumer/api/v2/bot/<YOUR_BOT_ID>/disable?auth=<YOUR_API_KEY>"

JavaScript (Fetch API)

fetch(`https://api.deadsimplechat.com/consumer/api/v2/bot/${YOUR_BOT_ID}/disable?auth=${YOUR_API_KEY}`, {
method: 'POST'
})
.then(response => response.json())
.then(data => console.log(data));