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

# Replace knowledge file

> Replace an existing knowledge base file. The uploaded filename may rename the file.



## OpenAPI

````yaml https://api.salesforge.ai/public/v2/swagger/doc.json put /workspaces/{workspaceID}/knowledges/{knowledgeID}/file
openapi: 3.1.0
info:
  description: Get mailboxes associated with the workspace.
  termsOfService: https://www.salesforge.ai/terms
  title: Salesforge API
  version: '2.0'
servers:
  - url: https://api.salesforge.ai/public/v2
security:
  - ApiKeyAuth: []
externalDocs:
  description: ''
  url: ''
paths:
  /workspaces/{workspaceID}/knowledges/{knowledgeID}/file:
    put:
      tags:
        - knowledge
      summary: Replace knowledge file
      description: >-
        Replace an existing knowledge base file. The uploaded filename may
        rename the file.
      parameters:
        - description: Workspace ID
          in: path
          name: workspaceID
          required: true
          schema:
            type: string
        - description: Knowledge ID
          in: path
          name: knowledgeID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              title: file
              type: file
          multipart/form-data:
            schema:
              type: object
        description: Replacement file (.pdf, .txt, .md, .csv, .html, .htm, .docx)
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.KnowledgeResponse'
          description: Updated knowledge file
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Knowledge file not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Knowledge filename already exists
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    api.KnowledgeResponse:
      properties:
        contentType:
          type: string
        embeddingStatus:
          type: string
        filename:
          type: string
        id:
          type: string
        size:
          type: integer
        tags:
          items:
            type: string
          type: array
          uniqueItems: false
        workspaceId:
          type: string
      type: object
    errors.Error:
      allOf:
        - $ref: '#/components/schemas/data'
      properties:
        data: {}
        message:
          type: string
      type: object
    data:
      properties:
        data:
          items:
            $ref: '#/components/schemas/api.DNCResponse'
          type: array
      type: object
    api.DNCResponse:
      properties:
        createdAt:
          type: string
        type:
          $ref: '#/components/schemas/models.DncType'
        value:
          type: string
      type: object
    models.DncType:
      enum:
        - email
        - domain
        - linkedin
      type: string
      x-enum-varnames:
        - DncTypeEmail
        - DncTypeDomain
        - DncTypeLinkedin
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````