v6

latestOpenAPI 3.0.1raw.githubusercontent.com2026-08-0182128753.1 KB
Documents

Create Document by Text

Creates a document in a knowledge base from raw text. Indexing runs asynchronously; track it with the returned batch ID via Get Document Indexing Status.

post/datasets/{dataset_id}/document/create-by-text

Path parameters

dataset_idstring uuid required

Knowledge base ID. From List Knowledge Bases.

Request body

namestring required

Document name.

textstring required

Document text content.

indexing_technique'high_quality' | 'economy'

Required when adding the first document to a knowledge base. Subsequent documents inherit the knowledge base's indexing technique if omitted. high_quality uses embedding models for precise search; economy uses keyword-based indexing.

doc_form'text_model' | 'hierarchical_model' | 'qa_model'

text_model for standard text chunking, hierarchical_model for parent-child chunk structure, qa_model for question-answer pair extraction.

doc_languagestring

Language of the document for processing optimization.

embedding_modelstring

Embedding model name. Use the model field from Get Available Models with model_type=text-embedding.

embedding_model_providerstring

Embedding model provider. Use the provider field from Get Available Models with model_type=text-embedding.

original_document_idstring

Original document ID for versioning. Get it from List Documents.

Response

Document created successfully.

batchstring

Batch ID for tracking indexing progress.