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

> Deletes a text-based knowledge base entry and all associated data by its unique ID.  **Cleanup:** Removes the text content, associated embeddings, and any agent references to this entry.

# Delete Text Entry

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml delete /ai-agents/agent-builder/knowledge-base/text/{uniqueId}
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/knowledge-base/text/{uniqueId}:
    delete:
      tags:
        - knowledge-base
      summary: Delete Text Entry
      description: >-
        Deletes a text-based knowledge base entry and all associated data by its
        unique ID.


        **Cleanup:** Removes the text content, associated embeddings, and any
        agent references to this entry.
      operationId: RagController_deleteText
      parameters:
        - name: uniqueId
          required: true
          in: path
          description: Unique text entry ID to delete
          schema:
            type: string
      responses:
        '200':
          description: Text entry deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Text detail and all associated data deleted successfully
                  data:
                    type: object
                    properties:
                      uniqueId:
                        type: string
                      fileName:
                        type: string
                      deletedFromAgents:
                        type: boolean
                      vectorsDeleted:
                        type: boolean
              example:
                success: true
                message: Text detail and all associated data deleted successfully
                data:
                  uniqueId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                  fileName: company-policy-document.md
                  uniqueFileId: file-uuid-123
                  deletedFromAgents: true
                  vectorsDeleted: true
                  s3FileDeleted: true
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````