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

# Update a knowledge base item

> Update a knowledge base item. Use when managing AI training content from an external pipeline.



## OpenAPI

````yaml put /knowledgebase-items/{id}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /knowledgebase-items/{id}:
    put:
      tags:
        - Knowledge Base
      summary: Update a knowledge base item
      description: >-
        Update a knowledge base item. Primarily used to set
        `restricted_to_segments` so the AI only uses the item for contacts in
        the given segments (empty = all contacts).
      operationId: updateKnowledgebaseItem
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: id
          required: true
          description: The knowledge base item id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePublicKnowledgebaseItem'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicKnowledgebaseItem'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    UpdatePublicKnowledgebaseItem:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/UpdatePublicKnowledgebaseItemInput'
      type: object
      properties:
        restricted_to_segments:
          description: >-
            Contact segment ids this item should be restricted to. Pass [] to
            make it available to all contacts.
          type: array
          items:
            type: string
        restricted_to_channels:
          description: >-
            Channels this item should be restricted to. Pass [] to make it
            available on all channels.
          type: array
          items:
            $ref: '#/components/schemas/SessionChannel'
        start_time:
          description: >-
            ISO 8601 instant (UTC) when the AI may start using this item. Null
            clears it.
          anyOf:
            - 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))$
            - type: 'null'
        end_time:
          description: >-
            ISO 8601 instant (UTC) when the AI stops using this item. Null
            clears it.
          anyOf:
            - 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))$
            - type: 'null'
        visibility:
          type: string
          enum:
            - internal
            - public
        title:
          type: string
    PublicKnowledgebaseItem:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PublicKnowledgebaseItem'
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        visibility:
          type: string
          enum:
            - internal
            - public
        source_type:
          type: string
          enum:
            - custom_training
            - help_center
            - integration
            - website
            - workflow
        data_source:
          description: External source the item was synced from (present when listing).
          anyOf:
            - type: string
              enum:
                - confluence
                - notion
                - zendesk_support
                - shopify
                - gitbook
                - intercom
                - front
                - freshdesk
                - hubspot_kb
                - sharepoint
                - genesys
                - ai_instructions
                - custom_training
                - website
                - workflow
                - help_center
            - type: 'null'
        stream:
          type:
            - string
            - 'null'
        folder_path:
          description: >-
            Synced folder trees (Confluence): folder ids from the source root
            down to the item (present when listing).
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        source_url:
          type:
            - string
            - 'null'
        restricted_to_segments:
          type: array
          items:
            type: string
          description: >-
            Contact segment ids this item is restricted to. Empty = available to
            all contacts.
        restricted_to_channels:
          type: array
          items:
            $ref: '#/components/schemas/SessionChannel'
          description: >-
            Channels this item is restricted to. Empty = available on all
            channels.
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Active window start (UTC). Null = no start bound.
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Active window end (UTC). Null = no end bound.
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - title
        - visibility
        - source_type
        - source_url
        - restricted_to_segments
        - restricted_to_channels
        - start_time
        - end_time
        - updated_at
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    SessionChannel:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SessionChannel'
      type: string
      enum:
        - web
        - email
        - phone_voice
        - slack
        - sms
        - whatsapp
        - instagram
        - messenger
        - api
        - web_voice
        - twitter
        - twitter_mentions
        - app_review
        - internal
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.