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

# Modifies a Knowledge Base.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /knowledge-bases/{knowledge_base_id}
openapi: 3.0.3
info:
  title: Totoy API
  description: >-
    Explain documents in simple, plain or detailed language and create Knowledge
    Bases from your documents in 19 languages.
  termsOfService: https://www.totoy.ai
  contact:
    name: Totoy Support
    email: support@totoy.ai
  license:
    name: MIT
    url: https://raw.githubusercontent.com/totoy-ai/totoy-openapi/main/LICENSE
  version: 1.1.5
servers:
  - url: https://api.totoy.ai/v1
security:
  - ApiKeyAuth: []
tags:
  - name: Explanation
    description: >-
      Given a document in any language, an output language and one of three
      language levels, the assistant will return an `Explanation` for this
      document.
  - name: Knowledge Bases
    description: >-
      Create `Knowledge Bases` from document or text `Sources` and chat with an
      assistant about them in 19 languages.
  - name: Sources
    description: >-
      `Sources` are used to upload documents (.pdf, .jpg or .png) or plain texts
      that can be used with features like `Explanation` or `Knowledge Bases.`
  - name: Projects
    description: '`Projects` are used to group `Knowledge Bases` and `Explanations`.'
  - name: Organization
    description: Get information about your `Organization`.
paths:
  /knowledge-bases/{knowledge_base_id}:
    patch:
      tags:
        - Knowledge Bases
      summary: Modifies a Knowledge Base.
      operationId: modifyKnowledgeBase
      parameters:
        - $ref: '#/components/parameters/knowledgeBaseIdParam'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyKnowledgeBaseRequest'
            examples:
              modify-knowledge-base-request-example:
                $ref: '#/components/examples/modify-knowledge-base-request-example'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBase'
              examples:
                knowledge-base-example-2:
                  $ref: '#/components/examples/knowledge-base-example-2'
        4XX:
          $ref: '#/components/responses/general4XXResponse'
        5XX:
          $ref: '#/components/responses/general5XXResponse'
components:
  parameters:
    knowledgeBaseIdParam:
      name: knowledge_base_id
      in: path
      required: true
      schema:
        type: string
        maxLength: 28
        pattern: ^kb_[a-zA-Z0-9]{25}$
      description: Unique identifier for a `Knowledge Base`.
      examples:
        knowledge-base-id-example:
          $ref: '#/components/examples/knowledge-base-id-example'
  schemas:
    ModifyKnowledgeBaseRequest:
      title: ModifyKnowledgeBaseRequest
      description: Request body for modifying a `Knowledge Base`.
      type: object
      additionalProperties: false
      properties:
        name:
          description: The name for the `Knowledge Base`.
          type: string
          maxLength: 255
          example: Totoy Developer Support Assistant
        instructions:
          description: The instructions for the `Knowledge Base`.
          type: string
          maxLength: 4096
          example: >-
            You are a developer support assistant for the developers using the
            Totoy API.
        project_id:
          description: >-
            The unique identifier for the `Project` that the `Knowledge Base`
            should be assigned to. If the `project_id` is changed, the
            `project_ids` of the `Sources` that are used as `Knowledge Base
            Sources` will also be changed. If a `Source` is used by multiple
            `Knowledge Bases`, then the `project_id` of the `Knowledge Base`
            cannot be changed.
          maxLength: 28
          pattern: ^pj_[a-zA-Z0-9]{25}$
          type: string
          example: pj_avX7imfLaPcQnv5ckvGlOEBA9
    KnowledgeBase:
      title: KnowledgeBase
      type: object
      additionalProperties: false
      properties:
        knowledge_base_id:
          description: The unique identifier for the `Knowledge Base`.
          maxLength: 28
          pattern: ^kb_[a-zA-Z0-9]{25}$
          type: string
          example: kb_feMfJbeqbAEj4u8K5HqmKpUbY
        name:
          description: The name for the `Knowledge Base`.
          type: string
          maxLength: 256
          example: Totoy Customer Support Assistant
        created_at:
          description: >-
            The date-time of when the `Knowledge Base` was created, in ISO 8601
            format.
          type: string
          format: date-time
          example: '2023-07-05T12:00:00Z'
        updated_at:
          description: >-
            The date-time of when the `Knowledge Base` was last modified, in ISO
            8601 format.
          type: string
          format: date-time
          example: '2023-07-05T12:00:00Z'
        instructions:
          description: The instructions for the `Knowledge Base`.
          type: string
          maxLength: 4096
          example: >-
            You are a customer support assistant for the customers of the
            company Totoy.
        project_id:
          description: >-
            The unique identifier for the `Project` that the `Knowledge Base` is
            assigned to.
          maxLength: 28
          pattern: ^pj_[a-zA-Z0-9]{25}$
          type: string
          example: pj_avX7imfLaPcQnv5ckvGlOEBA9
      required:
        - knowledge_base_id
        - name
        - created_at
        - updated_at
        - instructions
        - project_id
    Problem:
      title: Problem
      description: A Response Body for HTTP Problem Details in RFC 9457 format.
      type: object
      additionalProperties: false
      properties:
        type:
          description: A URI reference that identifies the problem type.
          type: string
          maxLength: 512
          example: https://docs.totoy.ai/probs/out-of-credit
        title:
          description: A short, human-readable summary of the problem type.
          type: string
          maxLength: 512
          example: You do not have enough credit.
        status:
          description: >-
            The HTTP status code generated by the origin server for this
            occurrence of the problem.
          type: integer
          format: int32
          example: 403
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          type: string
          maxLength: 4096
          example: You do not have enough credit to perform this operation.
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          type: string
          maxLength: 512
          example: /projects/pj_avX7imfLaPcQnv5ckvGlOEBA9
  examples:
    modify-knowledge-base-request-example:
      summary: Modify Knowledge Base Request Example
      description: >-
        An example for updating the `name` and `instructions` of a `Knowledge
        Base`.
      value:
        name: Totoy Developer Support Assistant
        instructions: >-
          You are a developer support assistant for the developers using the
          Totoy API.
    knowledge-base-example-2:
      summary: Knowledge Base Example 2
      description: >-
        An example for a modified `Knowledge Base`, where `name` and
        `instructions` have been updated.
      value:
        knowledge_base_id: kb_feMfJbeqbAEj4u8K5HqmKpUbY
        name: Totoy Developer Support Assistant
        instructions: >-
          You are a developer support assistant for the developers using the
          Totoy API.
        project_id: pj_avX7imfLaPcQnv5ckvGlOEBA9
        created_at: '2023-07-05T12:00:00Z'
        updated_at: '2023-07-15T12:34:56Z'
    knowledge-base-id-example:
      summary: Knowledge Base ID Example
      description: An example for a `knowledge_base_id`.
      value: kb_feMfJbeqbAEj4u8K5HqmKpUbY
  responses:
    general4XXResponse:
      description: Client Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    general5XXResponse:
      description: Server Error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````