> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Knowledge Base

> Deletes knowledge base by ID

Permanently delete a knowledge base and all its documents. This action cannot be undone.

## Path Parameters

<ParamField path="kb_id" type="string" required>
  Unique identifier of the knowledge base to delete (UUID format)
</ParamField>

## Response

Returns `202 Accepted` on successful deletion.

## Example Request

```bash theme={"dark"}
curl -X DELETE -H "x-api-key: <your-api-key>" \
  https://api.xpander.ai/v1/knowledge/<kb-id>
```

## Example Response

```
HTTP/1.1 202 Accepted
Content-Type: application/json

null
```

## Notes

* All documents in the knowledge base will be permanently removed
* All vector embeddings will be deleted from the search index
* Agents using this knowledge base will lose access to it
* This action cannot be undone
* Returns 404 if the knowledge base is not found


## OpenAPI

````yaml DELETE /v1/knowledge/{kb_id}
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/knowledge/{kb_id}:
    delete:
      tags:
        - API v1
        - Knowledge
        - Knowledge CRUD
      summary: Delete Knowledge Base
      description: Deletes knowledge base item by id
      operationId: Delete_knowledge_base_v1_knowledge__kb_id__delete
      parameters:
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
            title: Kb Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````