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

# Update Knowledge Base

> Update a knowledge base.

# Update Knowledge Base

This endpoint updates an existing knowledge base.

## Request

### Headers

| Name          | Type   | Required | Description                     |
| ------------- | ------ | -------- | ------------------------------- |
| Authorization | string | Yes      | Bearer token for authentication |
| Content-Type  | string | Yes      | application/json                |

### Path Parameters

| Name   | Type   | Required | Description                            |
| ------ | ------ | -------- | -------------------------------------- |
| kb\_id | string | Yes      | The ID of the knowledge base to update |

### Body

```json theme={null}
{
  "name": "string",
  "description": "string"
}
```

### Body Fields

| Field       | Type   | Required | Description                            |
| ----------- | ------ | -------- | -------------------------------------- |
| name        | string | No       | New name for the knowledge base        |
| description | string | No       | New description for the knowledge base |

## Response

### 200 OK

```json theme={null}
{
  "data": {
    "id": "string",
    "name": "string",
    "description": "string",
    "created_at": "string",
    "updated_at": "string",
    "organization_id": "string"
  }
}
```

### Response Fields

| Field            | Type   | Description                                         |
| ---------------- | ------ | --------------------------------------------------- |
| id               | string | Unique identifier for the knowledge base            |
| name             | string | Updated name of the knowledge base                  |
| description      | string | Updated description of the knowledge base           |
| created\_at      | string | Timestamp when the knowledge base was created       |
| updated\_at      | string | Timestamp when the knowledge base was last updated  |
| organization\_id | string | ID of the organization that owns the knowledge base |

## Example

```bash theme={null}
curl -X PUT 'https://api.kollie.ai/api/v1/knowledge-base/123e4567-e89b-12d3-a456-426614174000' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Updated Product Documentation",
    "description": "Updated documentation for our product features and services"
  }'
```


## OpenAPI

````yaml PUT /api/v1/knowledge-base/{kb_id}
openapi: 3.1.0
info:
  title: kollie-backend
  version: v1
servers: []
security: []
paths:
  /api/v1/knowledge-base/{kb_id}:
    put:
      tags:
        - knowledge-base
      summary: Update Knowledge Base
      description: Update a knowledge base.
      operationId: update_knowledge_base_api_v1_knowledge_base__kb_id__put
      parameters:
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Kb Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IKnowledgeBaseUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    IKnowledgeBaseUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
          description: Name of the knowledge base
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of the knowledge base
        organization_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Organization Id
      type: object
      title: IKnowledgeBaseUpdate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer

````