Delete a Chat Agent via API

Markdown

View as Markdown

Delete a Chat Agent via API

This article explains how to delete a Chat Agent (chatbot) from your Flora AI account using the API. Deleting a Chat Agent is permanent and cannot be undone, so ensure you really want to remove it before proceeding.


Overview

You can delete a Chat Agent by sending an authenticated DELETE request to the Flora AI API. Once the request is successful, the Chat Agent and its associated configuration will be removed from your account.


API Endpoint

Use the following endpoint to delete a specific Chat Agent:

https://app.floraai.me/en/chatbot/api/v1/delete-chatbot/your_chatbot_uuid/

Replace:

  • your_chatbot_uuid with the actual UUID of the Chat Agent you want to delete.

Example:

https://app.floraai.me/en/chatbot/api/v1/delete-chatbot/123e4567-e89b-12d3-a456-426614174000/

Required Request Headers

Your DELETE request must include the following headers:

Content-Type: application/jsonAuthorization: Token <Your-API-Token>

Where:

  • Content-Type specifies that the request body (if any) is JSON.

  • Authorization must contain your valid API token in the format:
    Token YOUR_API_TOKEN_HERE

You may also include:

Accept: application/json

to explicitly request a JSON response.


Request Example (Python)

Below is a complete example using Python and the requests library:

import requests# Define the API endpointurl = "https://app.floraai.me/en/chatbot/api/v1/delete-chatbot/your_chatbot_uuid/"# Set up authentication and headersheaders = {    'Authorization': 'Token <YOUR-API-TOKEN>',    'Content-Type': 'application/json',    'Accept': 'application/json'}# Send the DELETE requestresponse = requests.delete(url, headers=headers)# Process the responseif response.status_code in (200, 201, 202):    result = response.json()    print("Response data:", result)else:    try:        error_data = response.json()        error_message = error_data.get('message') or error_data.get('error', 'Unknown error')        print(f"Error: {error_message}")    except ValueError:        print(f"Error: Status code {response.status_code}")

Notes:

  • Ensure you replace:

  • your_chatbot_uuid with the actual Chat Agent UUID.

  • <YOUR-API-TOKEN> with your real API token.

  • A successful deletion typically returns a 200 (or sometimes 201/202) status code.


Response Example

On successful deletion, the API returns a JSON response similar to:

{    "message": "Your AI-Powered Chatbot has been deleted successfully."}

If the request fails (for example, due to an invalid token, missing permissions, or an incorrect UUID), you will receive an error response, which you can inspect using the error-handling logic in the example code.


Important Considerations

  • Irreversible action: Once deleted, the Chat Agent cannot be restored.

  • Permissions: Your API token must have sufficient permissions to delete Chat Agents in your account.

  • Correct UUID: Double-check the Chat Agent UUID before sending the request to avoid deleting the wrong Chat Agent.

Was this article helpful?

Still need help?

Contact us