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

# Update chunk metadata by chunk ID

> Update the metadata associated with the specified document chunk.



## OpenAPI

````yaml /specs/realtime/openapi.public.json patch /v1alpha1/public/knowledge-base/document/{documentID}/chunk/{chunkID}
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1alpha1/public/knowledge-base/document/{documentID}/chunk/{chunkID}:
    patch:
      tags:
        - KBPublicApiDocument
        - Public-Docs
      summary: Update chunk metadata by chunk ID
      description: Update the metadata associated with the specified document chunk.
      operationId: KnowledgeBaseDocumentApiPublicHTTPController_patchOneChunk
      parameters:
        - name: documentID
          in: path
          description: ID of the document to target.
          required: true
          schema:
            description: ID of the document to target.
            type: string
        - name: chunkID
          in: path
          description: ID of the document chunk to target.
          required: true
          schema:
            description: ID of the document chunk to target.
            type: string
      requestBody:
        required: true
        content:
          knowledgeBase:
            schema:
              $ref: '#/components/schemas/DocumentChunkUpdateMetadataRequest'
      responses:
        '200':
          description: The target document chunk was updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentChunkUpdateMetadataResponse'
      security:
        - auth: []
components:
  schemas:
    DocumentChunkUpdateMetadataRequest:
      type: object
      properties:
        data:
          type: object
          properties:
            metadata:
              description: >-
                Chunk-level metadata that can be used in a KB API query request.


                > **⚠️ Note:** This metadata can't be used in agent KB metadata
                filter conditions. Use `documentMetadata` instead if you need
                agent-level metadata filtering.
              type: object
              additionalProperties: {}
          required:
            - metadata
      required:
        - data
    DocumentChunkUpdateMetadataResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            documentID:
              type: string
            data:
              allOf:
                - $ref: '#/components/schemas/KBDocumentData'
              nullable: true
            updatedAt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            status:
              $ref: '#/components/schemas/KBDocumentStatus'
          required:
            - documentID
            - data
            - updatedAt
            - status
      required:
        - data
    KBDocumentData:
      oneOf:
        - $ref: '#/components/schemas/KBDocumentUrlData'
        - $ref: '#/components/schemas/KBDocumentDocxData'
        - $ref: '#/components/schemas/KBDocumentPDFData'
        - $ref: '#/components/schemas/KBDocumentTextData'
        - $ref: '#/components/schemas/KBDocumentMarkdownData'
        - $ref: '#/components/schemas/KBDocumentCSVData'
        - $ref: '#/components/schemas/KBDocumentXLSXData'
        - $ref: '#/components/schemas/KBDocumentTableData'
    KBDocumentStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/KnowledgeBaseDocumentStatus'
        data: {}
      required:
        - type
    KBDocumentUrlData:
      type: object
      properties:
        type:
          type: string
          enum:
            - url
          x-enumNames:
            - URL
        name:
          type: string
        url:
          type: string
        refreshRate:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseDocumentRefreshRate'
        lastSuccessUpdate:
          type: string
        accessTokenID:
          type: number
        integrationExternalID:
          type: string
        source:
          allOf:
            - $ref: '#/components/schemas/KnowledgeBaseDocumentIntegrationType'
      required:
        - type
        - name
        - url
    KBDocumentDocxData:
      type: object
      properties:
        type:
          type: string
          enum:
            - docx
          x-enumNames:
            - DOCX
        name:
          type: string
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentPDFData:
      type: object
      properties:
        type:
          type: string
          enum:
            - pdf
          x-enumNames:
            - PDF
        name:
          type: string
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentTextData:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
          x-enumNames:
            - TEXT
        name:
          type: string
        canEdit:
          type: boolean
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentMarkdownData:
      type: object
      properties:
        type:
          type: string
          enum:
            - md
          x-enumNames:
            - MD
        name:
          type: string
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentCSVData:
      type: object
      properties:
        type:
          type: string
          enum:
            - csv
          x-enumNames:
            - CSV
        name:
          type: string
        rowsCount:
          type: number
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentXLSXData:
      type: object
      properties:
        type:
          type: string
          enum:
            - xlsx
          x-enumNames:
            - XLSX
        name:
          type: string
        rowsCount:
          type: number
        url:
          type: string
          nullable: true
      required:
        - type
        - name
    KBDocumentTableData:
      type: object
      properties:
        type:
          type: string
          enum:
            - table
          x-enumNames:
            - TABLE
        name:
          type: string
        rowsCount:
          type: number
        url:
          type: string
          nullable: true
      required:
        - type
        - name
        - rowsCount
    KnowledgeBaseDocumentStatus:
      type: string
      enum:
        - ERROR
        - PENDING
        - SUCCESS
        - INITIALIZED
      x-enumNames:
        - ERROR
        - PENDING
        - SUCCESS
        - INITIALIZED
    KnowledgeBaseDocumentRefreshRate:
      type: string
      enum:
        - daily
        - weekly
        - monthly
        - never
      x-enumNames:
        - DAILY
        - WEEKLY
        - MONTHLY
        - NEVER
    KnowledgeBaseDocumentIntegrationType:
      type: string
      enum:
        - zendesk
        - shopify
      x-enumNames:
        - ZENDESK
        - SHOPIFY
  securitySchemes:
    auth:
      type: apiKey
      in: header
      name: authorization
      description: Voiceflow API key

````