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
| Parameter | Description | Data Type |
|---|---|---|
| botId | The ID of the bot to disable | String |
Query Parameters
| Parameter | Description | Data Type | Required |
|---|---|---|---|
auth | Go to Dashboard -> Developer -> Private Key is your auth | String | Yes |
Responses
Success Response
A JSON object containing the following fields:
| Field | Description | Data Type |
|---|---|---|
| success | Indicates the success flag | Boolean |
| bot | The disabled bot object | Object |
HTTP Status: 200 OK
Body:
{
"success": true,
"bot": { /* Bot object data */ }
}
Error Responses
-
Bot Not Found or Unauthorized:
HTTP Status:
401 UnauthorizedBody:
{"success": false,"message": "bot not found, or customer does not have permission to modify the bot"} -
General Error:
HTTP Status:
400 Bad RequestBody:
{"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));