# Update Knowledge Base

`PUT /api/v1/knowledge/{id}`

## Description
Update a knowledge base's name, description, or chunking configuration. At least one field must be provided.

## Parameters

- **id** (path) (required) — `string`: Knowledge base ID.

## Request Body

```json
{
  "type": "object",
  "required": [
    "workspaceId"
  ],
  "properties": {
    "workspaceId": {
      "type": "string",
      "description": "The workspace the knowledge base belongs to."
    },
    "name": {
      "type": "string",
      "description": "New name (1-255 characters).",
      "maxLength": 255
    },
    "description": {
      "type": "string",
      "description": "New description (max 1000 characters).",
      "maxLength": 1000
    },
    "chunkingConfig": {
      "type": "object",
      "description": "Configuration for how documents are split into chunks for embedding.",
      "properties": {
        "maxSize": {
          "type": "integer",
          "minimum": 100,
          "maximum": 4000,
          "default": 1024,
          "description": "Maximum chunk size in tokens."
        },
        "minSize": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000,
          "default": 100,
          "description": "Minimum chunk size in characters."
        },
        "overlap": {
          "type": "integer",
          "minimum": 0,
          "maximum": 500,
          "default": 200,
          "description": "Overlap between chunks in tokens."
        }
      }
    }
  }
}
```

## Responses

### 200 — Knowledge base updated successfully.

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Whether the request was successful."
    },
    "data": {
      "type": "object",
      "properties": {
        "knowledgeBase": {
          "type": "object",
          "description": "A knowledge base for storing and searching document embeddings.",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique knowledge base identifier."
            },
            "name": {
              "type": "string",
              "description": "Knowledge base name."
            },
            "description": {
              "type": "string",
              "nullable": true,
              "description": "Optional description."
            },
            "tokenCount": {
              "type": "integer",
              "description": "Total token count across all documents."
            },
            "embeddingModel": {
              "type": "string",
              "description": "Embedding model used (e.g. text-embedding-3-small)."
            },
            "embeddingDimension": {
              "type": "integer",
              "description": "Embedding vector dimension."
            },
            "chunkingConfig": {
              "$ref": "#/components/schemas/ChunkingConfig"
            },
            "docCount": {
              "type": "integer",
              "description": "Number of documents in the knowledge base."
            },
            "connectorTypes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Types of connectors attached to this knowledge base."
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "description": "ISO 8601 timestamp when the knowledge base was created."
            },
            "updatedAt": {
              "type": "string",
              "format": "date-time",
              "description": "ISO 8601 timestamp when the knowledge base was last modified."
            }
          }
        },
        "message": {
          "type": "string",
          "description": "Human-readable confirmation message."
        }
      },
      "description": "Response payload containing the updated knowledge base."
    }
  }
}
```

### 400 — Invalid request parameters. Check the details array for specific validation errors.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message describing the validation failure."
    },
    "details": {
      "type": "array",
      "description": "List of specific validation errors with field-level details.",
      "items": {
        "type": "object"
      }
    }
  }
}
```

### 401 — Invalid or missing API key. Ensure the X-API-Key header is set with a valid key.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 403 — Access denied. You do not have permission to access this resource. For audit log endpoints, this requires an Enterprise subscription and organization admin/owner role.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 404 — The requested resource was not found. Verify the ID is correct and belongs to your workspace.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message."
    }
  }
}
```

### 429 — Rate limit exceeded. Wait for the duration specified in the Retry-After header before retrying.

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable error message with rate limit details."
    }
  }
}
```
