> ## Documentation Index
> Fetch the complete documentation index at: https://hanabiaiinc-fish-772-enterprise-versions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Knowledge Source

> Rename the source and/or replace its content by uploading a new file in
`source` (multipart).



## OpenAPI

````yaml patch /v1/agent/knowledge-sources/{source_id}
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/knowledge-sources/{source_id}:
    patch:
      tags:
        - Knowledge Sources
      summary: Update Knowledge Source
      description: >-
        Rename the source and/or replace its content by uploading a new file in

        `source` (multipart). Replacing content increments `revision_number`
        while

        the id stays stable, and every attached agent's draft picks it up

        immediately; published versions pin the revision they were published
        with,

        so republish each affected agent to put the new content live — that

        two-step (sync content, republish) is the nightly content-sync recipe.
      parameters:
        - in: path
          name: source_id
          description: ''
          required: true
          schema:
            title: Source Id
            type: string
          deprecated: false
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              properties:
                source:
                  anyOf:
                    - format: binary
                      type: string
                    - type: 'null'
                  default: null
                  title: Source
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Name
                description:
                  anyOf:
                    - type: string
                    - type: 'null'
                  default: null
                  title: Description
              type: object
      responses:
        '200':
          description: Request fulfilled, document follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  knowledge_source_id:
                    title: Knowledge Source Id
                    type: string
                  workspace_id:
                    title: Workspace Id
                    type: string
                  name:
                    title: Name
                    type: string
                  description:
                    default: ''
                    title: Description
                    type: string
                  file_name:
                    title: File Name
                    type: string
                  size_bytes:
                    title: Size Bytes
                    type: integer
                  chunk_count:
                    title: Chunk Count
                    type: integer
                  revision_number:
                    description: >-
                      Increments every time the content is replaced. Drafts
                      always use the newest revision; published versions pin the
                      revision current at publish time.
                    title: Revision Number
                    type: integer
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                  content:
                    description: The full current text content.
                    title: Content
                    type: string
                required:
                  - knowledge_source_id
                  - workspace_id
                  - name
                  - file_name
                  - size_bytes
                  - chunk_count
                  - revision_number
                  - created_at
                  - updated_at
                  - content
                type: object
        '400':
          description: Bad request syntax or unsupported method
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````