Ingest raw text
POST /v1/knowledge-bases/{kb_id}/documents/text
Ingest raw text content into a knowledge base without uploading a file. The text is stored
as a .txt file and processed through the same ingestion pipeline as file uploads.
Returns immediately with a 202 Accepted response containing the document record in pending status.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Example
kb_a1b2c3d4e5Knowledge base ID
Request Body required
Section titled “Request Body required ”object
Raw text content to ingest
Example
Machine learning is a subset of artificial intelligence...Optional document name. Defaults to text-{timestamp}.txt.
Example
ml-notes.txtArbitrary JSON metadata to attach to the document
object
Example
{ "source": "api", "category": "notes"}Responses
Section titled “ Responses ”Text accepted for processing
object
object
Document ID (prefixed with doc_)
Example
doc_f6g7h8i9j0Parent knowledge base ID
Example
kb_a1b2c3d4e5Owning account ID
Example
acc_x9y8z7w6v5Original file name
Example
product-guide.pdfFile extension
Example
pdfFile size in bytes
Example
2048576Number of pages (for Tier 1 files, set after parsing)
Example
15Number of chunks generated from this document
Example
34Error message if status is failed
User-supplied metadata (filterable at search time)
object
Example
{ "department": "engineering", "version": 2}Internal storage path
Example
acc_x9y8z7w6v5/kb_a1b2c3d4e5/doc_f6g7h8i9j0/product-guide.pdfExample
2026-02-10T12:00:00.000ZExample
2026-02-10T12:01:30.000ZRequest validation failed
object
object
Machine-readable error code
Example
VALIDATION_ERRORHuman-readable error message
Example
Invalid request bodyAdditional error details (e.g., validation issues)
object
Example
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid request body", "details": { "issues": [ { "path": [ "name" ], "message": "Required" } ] } }}Authentication failed or missing
object
object
Machine-readable error code
Example
VALIDATION_ERRORHuman-readable error message
Example
Invalid request bodyAdditional error details (e.g., validation issues)
object
Example
{ "error": { "code": "AUTHENTICATION_ERROR", "message": "Invalid or missing API key" }}Resource not found
object
object
Machine-readable error code
Example
VALIDATION_ERRORHuman-readable error message
Example
Invalid request bodyAdditional error details (e.g., validation issues)
object
Example
{ "error": { "code": "NOT_FOUND", "message": "KnowledgeBase not found: kb_nonexistent" }}Rate limit or usage limit exceeded
object
object
Machine-readable error code
Example
VALIDATION_ERRORHuman-readable error message
Example
Invalid request bodyAdditional error details (e.g., validation issues)