Delete Knowledge Base

Delete Knowledge Base
Delete an existing knowledge base.

This method allows you to delete a previously created knowledge base using its ID.

You can obtain the ID of the knowledge base to delete either from the API response when you created the knowledge base, or by listing the available knowledge bases. Note that knowledge bases that are in use by an agent cannot be deleted. If you attempt to do so, the API will raise an error. In this case, you have to unlink the knowledge base from all agents before being able to delete it.

When asynchronous deletion is requested (via async_mode=true), the knowledge base is marked for deletion but continues to be visible in the API until all content has been fully removed.

Request
URI
DELETE
https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}
COPY
Path Parameters
string
knowledge_base_id
Required  

knowledge_base_id

Query Parameters
boolean
async_mode
Optional Deprecated
Constraints: default: false

When true, the deletion is performed asynchronously in the background. Synchronous deletion (async_mode=false) is subject to removal in a future release. Only asynchronous deletion will be supported going forward. Callers should migrate to async_mode=true and poll GET /knowledge-bases/{id} until the resource returns HTTP 404.


Authentication
This operation uses the following authentication methods.
Responses
200

Successful Response

Returns DeletionStatusResponse of type(s) application/json
{
    "id": "string",
    "object": "string",
    "deleted": false
}
string As uuid As uuid
id
Required  

id

string
object
Required  

object

boolean
deleted
Required  

deleted


404

Invalid knowledge base ID.

Operation doesn't return any data structure

409

The knowledge base is not in a state where it can be deleted.

Operation doesn't return any data structure

422

Validation Error

Returns HTTPValidationError of type(s) application/json
{
    "detail": [
        {
            "loc": [
                {}
            ],
            "msg": "string",
            "type": "string",
            "ctx": {}
        }
    ]
}
array of object
detail
Optional

detail


Code Samples
COPY
                    curl -X DELETE -H 'Authorization: <value>' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}