Delete a Chatbot
Delete a Chatbot
This endpoint allows you to permanently delete a chatbot from your Nexvio.ai account.
Endpoint
DELETE https://api.nexvio.ai/v1/chatbots/{chatbotId}Headers
| Name | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format: Bearer YOUR_API_KEY |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The ID of the chatbot to delete |
Response
{ "status": "success", "data": { "deleted": true, "id": "chatbot_456def" }}Error Responses
Authentication Error
{ "status": "error", "error": { "code": "unauthorized", "message": "Invalid API key" }}Not Found Error
{ "status": "error", "error": { "code": "not_found", "message": "Chatbot not found" }}Forbidden Error
{ "status": "error", "error": { "code": "forbidden", "message": "You don't have permission to delete this chatbot" }}Important Notes
- This action is permanent and cannot be undone. All associated data, including conversation history, will be deleted.
- All active integrations with this chatbot will stop working immediately.
- If the chatbot is embedded on websites, the embed code will no longer function.
- To temporarily disable a chatbot without deleting it, consider updating its settings instead.
Best Practices
-
Backup data: Before deleting a chatbot, consider exporting any important conversation data or leads that you may need in the future.
-
Update website code: If the chatbot is embedded on your website, make sure to remove or update the embed code after deletion to prevent errors for your users.
-
Notify team members: If multiple team members use this chatbot, ensure they’re informed before deletion.
-
Check integrations: If the chatbot is integrated with other systems (via API, webhooks, or platforms like Slack), update those integrations accordingly.
Code Examples
cURL
curl -X DELETE "https://api.nexvio.ai/v1/chatbots/chatbot_456def" \ -H "Authorization: Bearer YOUR_API_KEY"JavaScript
const chatbotId = 'chatbot_456def';const response = await fetch(`https://api.nexvio.ai/v1/chatbots/${chatbotId}`, { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_API_KEY' }});
const data = await response.json();console.log(data);
if (data.status === 'success') { console.log(`Chatbot ${chatbotId} has been successfully deleted.`); // Update your UI or perform any cleanup}Python
import requests
chatbot_id = "chatbot_456def"url = f"https://api.nexvio.ai/v1/chatbots/{chatbot_id}"headers = { "Authorization": "Bearer YOUR_API_KEY"}
response = requests.delete(url, headers=headers)data = response.json()print(data)
if data["status"] == "success": print(f"Chatbot {chatbot_id} has been successfully deleted.") # Perform any cleanup actionsRecommended Workflow for Chatbot Replacement
If you’re deleting a chatbot to replace it with a new one, follow this recommended workflow:
- Create the new chatbot first
- Test the new chatbot thoroughly
- Update all integrations and embed codes to point to the new chatbot
- Verify the new chatbot is working correctly in all contexts
- Only then delete the old chatbot
This approach ensures minimal disruption to your users and prevents any downtime in your chatbot service.