---
title: "Add Knowledge Base Text Document"
method: POST
path: "/knowledge-bases/{kbId}/documents/manual"
tags: ["Knowledge Base"]
---

# Add Knowledge Base Text Document

`POST /knowledge-bases/{kbId}/documents/manual`

## Request

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

### Add a Text Document

Requires the OWNER or ADMIN role. Adds a document with text you supply directly -- the only way this endpoint set creates a document (uploading a file or crawling a website use endpoints not covered here). Kicks off embedding immediately; status starts at uploaded and moves toward ready on its own.

## Path parameters

- `kbId` string, required

## Request body

- object
  - `title` string, required: Up to 200 characters. Required.
  - `text` string, required: Required, non-empty. Size-capped server-side; an oversized submission is a 400 asking you to split it into smaller entries.

## Response `201`

Created

- object
  - `status` 'success'
  - `data` object
    - `documentId` string: Server-generated. Immutable.
    - `knowledgeBaseId` string
    - `source` 'upload' | 'website' | 'manual': This endpoint set only creates manual documents; upload and website documents come from endpoints not covered here.
    - `title` string
    - `description` string, nullable
    - `fileName` string, nullable: Set only for an uploaded file.
    - `mimeType` string, nullable
    - `sizeBytes` number
    - `sourceUrl` string, nullable: Set only for a website document.
    - `pageUrl` string, nullable: Set only for a website document.
    - `status` 'uploaded' | 'parsing' | 'parsed' | 'embedding' | 'ready' | 'failed'
    - `error` string, nullable
    - `parse` object, nullable
      - `engine` string
      - `pages` number
      - `costUsd` number
      - `parsedAt` string, date-time
    - `createdAt` string, date-time

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found

---

[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)
