---
title: "Create Knowledge Base"
method: POST
path: "/v1/knowledge"
tags: ["API v1", "Knowledge", "Knowledge CRUD"]
---

# Create Knowledge Base

`POST /v1/knowledge`

## 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`
- Auth: API key in header `x-api-key`

Creates a knowledge base

## Request body

- CreateManagedKnowledgeBaseRequest
  - `name` string, required: KB name specified by the user
  - `description` string, nullable: KB description specified by the user
  - `project_id` string, nullable: The project to create the KB in; unset means the Default project. Ignored on update.

## Response `201`

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/725c0066d5df?raw)
