---
title: "Update Knowledge Base"
method: PATCH
path: "/v1/knowledge/{kb_id}"
tags: ["API v1", "Knowledge", "Knowledge CRUD"]
---

# Update Knowledge Base

`PATCH /v1/knowledge/{kb_id}`

## Request

- Base URL: `https://api.xpander.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xpander.ai/v1/knowledge/{kb_id}`
- Auth: API key in header `x-api-key`

Updates a knowledge base. Only the fields you send change; send description null to clear it. agent_id cannot be changed.

## Path parameters

- `kb_id` string, required

## Request body

- UpdateKnowledgeBaseRequest: Partial update: only the fields the caller sends change.
  - `name` string, nullable: New KB name; omit to keep the current name
  - `description` string, nullable: New KB description; omit to keep it, send null to clear it

## Response `200`

Successful Response

- KnowledgeBaseItem: Represents a Knowledge Base item. Attributes: id (str): KB unique identifier. name (str): KB name specified by the user. description (str): KB description specified by the user. type (KnowledgeBaseType): KB type, either managed or external. organization_id (str): Organization ID associated with the KB. total_documents (int): Total count of embedded documents. Defaults to 0.
  - `id` string, required: KB unique identifier
  - `name` string, required: KB name specified by the user
  - `description` string, nullable: KB description specified by the user
  - `type` 'managed' | 'external', required
  - `organization_id` string, required: Organization ID
  - `agent_id` string, nullable: Agent ID
  - `project_id` string, nullable: The project the item belongs to; unset means the org's Default project on create.
  - `total_documents` integer: Total count of embedded documents

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xpander/apis/xpander-ai-api-service.md) - [All operations](https://skmtc.dev/xpander/apis/xpander-ai-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/xpander/apis/xpander-ai-api-service/revisions/4389ec0875d0?raw)
