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

# Update Knowledge Base Document

> Update a document in a knowledge base



## OpenAPI

````yaml patch /v1/knowledge-bases/{knowledge_base_id}/document/{document_id}
openapi: 3.1.0
info:
  title: Noxus Backend
  description: >-
    Backend API for the Noxus Platform. More information can be found at
    https://docs.noxus.ai
  version: 1.1.0
servers: []
security: []
paths:
  /v1/knowledge-bases/{knowledge_base_id}/document/{document_id}:
    patch:
      tags:
        - V1 - Knowledge Bases
      summary: Update Knowledge Base Document
      operationId: update_knowledge_base_document
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          schema:
            type: string
            title: Knowledge Base Id
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocument'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseDocument'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    UpdateDocument:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        short_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Short Summary
        status:
          anyOf:
            - $ref: '#/components/schemas/DocumentStatus'
            - type: 'null'
        doc_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Type
        error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error
        warnings:
          anyOf:
            - items:
                $ref: '#/components/schemas/SpotWarning'
              type: array
            - type: 'null'
          title: Warnings
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        file_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: File Id
        dismissed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dismissed
        needs_reingestion:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Needs Reingestion
      type: object
      title: UpdateDocument
    KnowledgeBaseDocument:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        short_summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Short Summary
        doc_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Type
        source_type:
          anyOf:
            - $ref: '#/components/schemas/SourceType'
            - type: 'null'
        source_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Source Metadata
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
        has_conversion:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Has Conversion
        status:
          $ref: '#/components/schemas/DocumentStatus'
        doc_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Doc Metadata
        error:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Error
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_at:
          type: string
          format: date-time
          title: Created At
        size:
          type: integer
          title: Size
        file_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: File Id
        run_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Run Id
        dismissed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dismissed
        warnings:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Warnings
        needs_reingestion:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Needs Reingestion
      type: object
      required:
        - id
        - summary
        - status
        - error
        - updated_at
        - created_at
        - size
      title: KnowledgeBaseDocument
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentStatus:
      type: string
      enum:
        - trained
        - training
        - error
        - uploaded
        - folder
      title: DocumentStatus
    SpotWarning:
      properties:
        detail:
          type: string
          title: Detail
        identifier:
          $ref: '#/components/schemas/WarningIdentifier'
        node_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Node Id
        params:
          additionalProperties: true
          type: object
          title: Params
          default: {}
        markdown:
          anyOf:
            - type: string
            - type: 'null'
          title: Markdown
        snippet:
          anyOf:
            - type: string
            - type: 'null'
          title: Snippet
      type: object
      required:
        - detail
        - identifier
      title: SpotWarning
    SourceType:
      type: string
      enum:
        - Document
        - Google Drive
        - Notion
        - Website
        - OneDrive
        - Slack
        - Linear
        - Github
        - Teams
        - Sharepoint
        - ServiceNow
        - Custom
      title: SourceType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WarningIdentifier:
      type: string
      enum:
        - general
        - model_fallback
        - model_timeout
        - reading_spreadsheet
        - invalid_search
        - no_results_returned
        - integration_warning
        - failed_scraping
        - invalid_value
        - continue_on_error
        - data_ingestion
        - document_already_exists
        - ingestion_timeout
        - libreoffice_conversion
        - low_confidence
        - guardrail_validation
        - kb_creation
        - kb_empty
        - unsupported_qa_file_type
        - unsupported_file_type
        - no_files_to_add_to_kb
        - no_files_added_to_kb
        - no_google_drive_files
        - no_one_drive_files
        - no_sharepoint_files
        - no_websites_scraped
        - websites_failed_scraping
        - empty_file
        - document_overwrite
        - no_content_provided
        - invalid_folder
        - document_name_too_long
        - retry_warning
      title: WarningIdentifier
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````