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.
Authorizations
Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).
Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).
Path Parameters
Knowledge base ID. From List Knowledge Bases.
Body
Document name.
Document text content.
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.
high_quality, economy text_model for standard text chunking, hierarchical_model for parent-child chunk structure, qa_model for question-answer pair extraction.
text_model, hierarchical_model, qa_model Language of the document for processing optimization.
Processing rules for chunking.
Controls how chunks are searched and ranked when querying this knowledge base.
Embedding model name. Use the model field from Get Available Models with model_type=text-embedding.
Embedding model provider. Use the provider field from Get Available Models with model_type=text-embedding.
Original document ID for versioning. Get it from List Documents.