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

# Edit Knowledge Base

> Update a knowledge base.



## OpenAPI

````yaml PATCH /orgs/{org_id}/k2/{kb_id}
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: analytics
    description: Org and project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/k2/{kb_id}:
    patch:
      tags:
        - k2
      description: Update a knowledge base.
      operationId: handler
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditK2Request'
        required: true
      responses:
        '200':
          description: Updated knowledge base
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/K2Detail'
      security:
        - bearer_auth: []
components:
  schemas:
    EditK2Request:
      type: object
      properties:
        auto_processing_enabled:
          type:
            - boolean
            - 'null'
          description: >-
            Toggle the automatic parsing, chunking, and embedding pipeline for
            new file uploads. When false, uploads are stored as-is. Existing
            files are not affected.
        backup_enabled:
          type:
            - boolean
            - 'null'
          description: >-
            DEPRECATED and ignored: backups are system-managed for every KB;
            this

            flag gates nothing. Accepted for old clients, never applied.
          deprecated: true
        backup_retention_days:
          type:
            - integer
            - 'null'
          format: int32
          description: |-
            DEPRECATED and ignored: snapshot retention is system-managed
            (keep-last-N). Accepted for old clients, never applied.
          deprecated: true
        backup_s3_bucket:
          type:
            - string
            - 'null'
        backup_s3_key_prefix:
          type:
            - string
            - 'null'
        backup_schedule_cron:
          type:
            - string
            - 'null'
          description: |-
            DEPRECATED and ignored: superseded by `backup_window_utc_hour`.
            Accepted for old clients, never applied.
          deprecated: true
        backup_window_utc_hour:
          type:
            - integer
            - 'null'
          format: int32
          description: |-
            UTC hour (0–23) when this KB's fixed daily backup may run.
            Set `null` to reset to the fleet default (01:00 UTC).
        description:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
    K2Detail:
      type: object
      required:
        - id
        - uid
        - name
        - data_size_bytes
        - table_count
        - row_count
        - vector_count
        - index_count
        - auto_processing_enabled
        - governance_mode
        - backup_enabled
        - created_at
        - updated_at
      properties:
        auto_processing_enabled:
          type: boolean
          description: >-
            When false, file uploads to this knowledge base are stored as-is and
            skipped by the automatic parsing, chunking, and embedding pipeline.
        backup_enabled:
          type: boolean
          description: |-
            DEPRECATED: backups are system-managed for every KB (idle teardown +
            daily window pass); this flag gates nothing. Still returned for
            existing clients; PATCH ignores it.
          deprecated: true
        backup_last_completed_at:
          type:
            - string
            - 'null'
          format: date-time
        backup_last_error:
          type:
            - string
            - 'null'
        backup_last_started_at:
          type:
            - string
            - 'null'
          format: date-time
        backup_last_status:
          type:
            - string
            - 'null'
        backup_retention_days:
          type:
            - integer
            - 'null'
          format: int32
        backup_s3_bucket:
          type:
            - string
            - 'null'
        backup_s3_key_prefix:
          type:
            - string
            - 'null'
        backup_schedule_cron:
          type:
            - string
            - 'null'
          description: |-
            DEPRECATED: never had a cron behind it; superseded by
            `backup_window_utc_hour`. Still returned for existing clients; PATCH
            ignores it.
          deprecated: true
        backup_window_utc_hour:
          type:
            - integer
            - 'null'
          format: int32
          description: |-
            UTC hour (0–23) of this KB's daily backup window; `null` = fleet
            default (01:00 UTC). The daily cadence itself is fixed.
        created_at:
          type: string
          format: date-time
        data_size_bytes:
          type: integer
          format: int64
          minimum: 0
        description:
          type:
            - string
            - 'null'
        governance_mode:
          $ref: '#/components/schemas/K2GovernanceMode'
          description: >-
            Query-time governance mode. Toggle via `PUT
            …/k2/{kb_id}/policies/governance-mode` (`k2.policies.manage`).
        id:
          type: integer
          format: int64
        index_count:
          type: integer
          format: int64
          minimum: 0
        name:
          type: string
        row_count:
          type: integer
          format: int64
          minimum: 0
        table_count:
          type: integer
          format: int64
          minimum: 0
        uid:
          type: string
        updated_at:
          type: string
          format: date-time
        vector_count:
          type: integer
          format: int64
          minimum: 0
    K2GovernanceMode:
      type: string
      description: Per-KB query governance mode.
      enum:
        - 'off'
        - shadow
        - enforce
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````