> ## 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.

> Updates a specific text-based knowledge base entry by its unique ID. Use this endpoint to modify the title or content of an existing text entry.  **Re-indexing:** The content is re-uploaded and the en

# Update Text Entry

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


## OpenAPI

````yaml patch /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}:
    patch:
      tags:
        - knowledge-base
      summary: Update Text Entry
      description: >-
        Updates a specific text-based knowledge base entry by its unique ID. Use
        this endpoint to modify the title or content of an existing text entry.


        **Re-indexing:** The content is re-uploaded and the entry status is
        reset to indexing.
      operationId: RagController_updateTextDetail
      parameters:
        - name: uniqueId
          required: true
          in: path
          description: Unique text detail ID
          schema:
            example: f47ac10b-58cc-4372-a567-0e02b2c3d479
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTextDetailDto'
            examples:
              example1:
                summary: Update text detail
                value:
                  title: Updated Company Policy Document
                  text: >-
                    This is the updated document content with new policies and
                    procedures...
      responses:
        '200':
          description: Text detail updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      uniqueId:
                        type: string
                      title:
                        type: string
                      fileName:
                        type: string
                      s3Key:
                        type: string
                      status:
                        type: string
                      vectorizationStatus:
                        type: string
              example:
                success: true
                message: Text detail updated successfully
                data:
                  uniqueId: f47ac10b-58cc-4372-a567-0e02b2c3d479
                  title: Updated Title
                  fileName: updated-title.md
                  s3Key: my-app-id/text/f47ac10b/updated-title.md
                  status: indexing
      security:
        - apiKey: []
components:
  schemas:
    UpdateTextDetailDto:
      type: object
      properties:
        title:
          type: string
          description: Title of the text content
          example: Updated Company Policy Document
          maxLength: 500
        text:
          type: string
          description: Text content to be processed
          example: >-
            This is the updated document content with new policies and
            procedures...
          maxLength: 5000
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````