---
title: "Create knowledge base"
method: POST
path: "/v1/knowledge-bases"
tags: ["Knowledge bases"]
---

# Create knowledge base

`POST /v1/knowledge-bases`

Creates a knowledge base by providing a name, optional text snippets, URLs, and file attachments. Sources are processed in order: text, URLs, then files. Supported file types include PDF, TXT, HTML, Markdown, and DOCX. Maximum file size is 25 MB.

## Query parameters

- `knowledge_base_name` string, required
- `knowledge_base_texts` string
- `knowledge_base_urls` string

## Response `201`

Created.

- KnowledgeBaseResponse — A knowledge base and its sources.
  - `kbId` string, required — Use this id in the URL when fetching, updating, or deleting this knowledge base.
  - `name` string, required — Knowledge base name
  - `files` KnowledgeBaseFileResponse[], required — Ordered sources; each item has documentId, type, and content.
    - `documentId` string, required — Stable id for this source; use when updating or deleting a single document.
    - `type` 'file' | 'url' | 'text', required — Source row kind. In JSON request and response bodies.
    - `content` string, required — Stored link, path, or text for this source.
  - `createdAt` string, date-time, required — When the knowledge base was created.
  - `updatedAt` string, date-time, required — When the knowledge base or its sources were last changed.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `413` — Payload Too Large
- `415` — Unsupported Media Type
- `500` — Internal Server Error

---

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