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

# Update a knowledge base item by Id.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/voice-agents/knowledge-base/{id}
openapi: 3.0.1
info:
  title: Hamsa API
  description: Trying out our transcription and media-to-text APIs
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tryhamsa.com
security: []
paths:
  /v1/voice-agents/knowledge-base/{id}:
    patch:
      summary: Update a knowledge base item by Id.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateKnowledgeBaseItemRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateKnowledgeBaseItemResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '403':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateKnowledgeBaseItemRequest:
      type: object
      properties:
        itemName:
          type: string
          description: The name of the knowledge base item to update.
          minLength: 1
          maxLength: 250
          example: Updated Product Documentation
      required:
        - itemName
    UpdateKnowledgeBaseItemResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
        message:
          type: string
          default: success
        data:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier of the knowledge base item.
              example: 550e8400-e29b-41d4-a716-446655440000
            userId:
              type: string
              description: The user ID associated with the knowledge base item.
              example: 550e8400-e29b-41d4-a716-446655440000
            projectId:
              type: string
              description: The project ID associated with the knowledge base item.
              example: 550e8400-e29b-41d4-a716-446655440000
            itemName:
              type: string
              description: The name of the knowledge base item.
              example: Updated Product Documentation
            fileSize:
              type: string
              description: The size of the file.
              example: 2.5MB
            type:
              type: string
              description: The type of the knowledge base item.
              enum:
                - TEXT
                - URL
                - FILE
              example: TEXT
            status:
              type: string
              description: The current status of the knowledge base item.
              example: PROCESSED
            failureReason:
              type: string
              description: The reason for failure if the item processing failed.
              example: File format not supported
            content:
              type: string
              description: The text content of the knowledge base item.
              example: This is the updated content of the knowledge base item...
            itemUrl:
              type: string
              description: The URL of the knowledge base item.
              example: https://example.com/updated-document.pdf
            itemUrls:
              type: array
              description: The URLs of the item (required when the type is URL).
              items:
                type: string
                description: >-
                  The URL item of the URLs array (required when the type is
                  URL).
                example: https://example.com/document.pdf
              example:
                - https://example.com/document.pdf
            wordsNumber:
              type: number
              description: The words count in the knowledge base item.
              example: 1298
            extension:
              type: string
              description: The extension of the knowledge base item in case it was a file.
              example: 1298
            createdAt:
              type: string
              format: date-time
              description: The timestamp when the knowledge base item was created.
              example: '2024-01-15T10:30:00Z'
            updatedAt:
              type: string
              format: date-time
              description: The timestamp when the knowledge base item was last updated.
              example: '2024-01-20T14:45:00Z'
    ErrorSchema:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass the API key in the Authorization header, You need to put Token
        keyword before the API key. e.g. 'Authorization: Token <api-key>'

````