Skip to main content

Remove Chatbot

The Neoagent API allows you to delete a specific chatbot by sending a POST request to the /chat/Chatbot/Remove endpoint.

Attention

Deleting a chatbot is an irreversible operation. All data associated with the chatbot will be permanently removed.

Endpoint​

Request URL: https://app.neoagent.co/chat/Chatbot/Remove
Method: POST

Required Headers​

The API request must include the following headers:

  • Authorization: <Your-Secret-Key> - string, required - The secret key to authenticate the API request
  • Content-Type: application/json - string, required - The content type of the request payload

Request Body​

The request body must contain the following parameters:

{
// string, required - The unique identifier (ID) of the chatbot to be deleted
"serialNumber": "3254a9d0424c4806b9ea3d0763ccfxxx"
}

Parameters​

  • serialNumber - string, required - The unique identifier (ID) of the chatbot to be deleted

Request Examples​

const res = await fetch('https://app.neoagent.co/chat/Chatbot/Remove', {
method: 'POST',
headers: {
"Authorization": "<Your-Secret-Key>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"serialNumber": "3254a9d0424c4806b9ea3d0763ccfxxx"
})
});

const data = await res.json();
console.log(data);

Response​

The API response will be a JSON object with the following structure:

{
// string - API version
"Version": "1.0.0",
// boolean - Success status of the operation
"Success": true,
// integer - HTTP status code
"Code": 200,
// string - Error message if present
"Message": ""
}

Error Handling​

If the request fails, you should:

  1. Check the HTTP status code for network-level errors
  2. Examine the fields Code and Message in the response for business-level errors
  3. The field Message will contain detailed information about the error

Possible Errors​

CodeDescription
400Missing or invalid parameters
401Invalid API key
404Chatbot not found
403Not authorized to delete this chatbot

Example Error Response​

{
"Version": "1.0.0",
"Success": false,
"Code": 404,
"Message": "Chatbot not found"
}

Important Notes​

Before Deletion​

Before deleting a chatbot, consider:

  • Data backup: Export important conversations and statistics
  • Dependencies: Check if other services depend on this chatbot
  • Integrations: Update webhooks and integrations pointing to this chatbot

Consequences of Deletion​

When you delete a chatbot:

  • ❌ All conversations are permanently deleted
  • ❌ The associated knowledge base is removed
  • ❌ Configurations and settings are lost
  • ❌ Statistics and analytics are deleted
Irreversible Operation

Once deleted, a chatbot cannot be restored. Ensure you have backed up all important data before proceeding.