---
title: "Create Knowledge Base Collection"
method: POST
path: "/knowledge-bases"
tags: ["Knowledge Base"]
---

# Create Knowledge Base Collection

`POST /knowledge-bases`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/knowledge-bases`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

### Create Collection

Requires the OWNER or ADMIN role. Creates an empty document collection. Add documents to it with the manual-document endpoint, then attach it to a folder or agent with the map endpoint so something actually uses it.

## Request body

- object
  - `name` string, required: Up to 200 characters. Required.
  - `description` string: Up to 1000 characters. Optional.

## Response `201`

Created

- object
  - `status` 'success'
  - `data` object
    - `knowledgeBaseId` string: Server-generated. Immutable. The identifier used everywhere for this collection.
    - `name` string: Up to 200 characters.
    - `description` string, nullable: Up to 1000 characters.
    - `documents` object
      - `embeddingStatus` 'pending' | 'processing' | 'completed' | 'failed'
      - `lastIndexedAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Bad Request
- `403`: Forbidden

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
