---
title: "Create a new knowledge base"
method: POST
path: "/knowledgeBase"
tags: ["Knowledge Base"]
---

# Create a new knowledge base

`POST /knowledgeBase`

Create a new knowledge base for organizing and managing documents within your organization.

**Overview:**

A knowledge base is a container for organizing related documents, files, and content. It provides a central location for teams to collaborate on shared information.

**Features:**

- Hierarchical folder structure support
- Role-based access control (OWNER, WRITER, READER)
- Full-text search across all records
- Integration with external connectors (Google Drive, OneDrive, etc.)
- Automatic content indexing for AI-powered search

**Naming Rules:**

- Name must be 1-255 characters
- Special characters and HTML tags are sanitized
- Names don't need to be unique within organization

**Creator Permissions:**

The user creating the KB automatically becomes the OWNER with full administrative rights.

## Request body

- object
  - `kbName` string, required — Name of the knowledge base

## Response `200`

Knowledge base created successfully

- KnowledgeBaseCreateResponse — Response returned when a knowledge base is created
  - `id` string, required — Knowledge base ID
  - `name` string, required — Knowledge base name
  - `createdAtTimestamp` integer, required — Creation timestamp in milliseconds
  - `updatedAtTimestamp` integer, required — Last update timestamp in milliseconds
  - `userRole` 'OWNER' | 'WRITER' | 'READER', required — User's role in this knowledge base

## Other responses

- `400` — **Invalid request:** - Name too short or too long - Invalid characters in name
- `401` — Unauthorized - Valid bearer token required
- `403` — Forbidden. Possible reasons: - OAuth token lacks the `kb:write` scope - Connector service denied the request
- `404` — User not found - Authenticated user does not exist in the graph database
- `500` — Internal server error - Knowledge base creation failed in connector or database
- `503` — Service unavailable - Connector service is unreachable

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/versions/abd27cfefc73/schema)
