Skip to main content
POST
Create text document

Authorizations

Authorization
string
header
required

Voiceflow bearer token

Query Parameters

projectID
string
required

The ID of the project to operate on.

environmentAlias
string
required

The alias of the environment to operate on (e.g. main).

maxChunkSize

Determines how granularly each document is broken up. Range available is 500-1500 tokens, default is 1000. Smaller chunk size means narrower context, faster response, less tokens consumed, and greater risk of less accurate answers. Max chunk size affects the total amount of chunks parsed from a document - i.e., larger chunks means less chunks retrieved.

overwrite

If set to true, the existing table with the same name will be overwritten.

markdownConversion

When enabled, HTML is automatically converted to markdown to generate better chunks.

llmBasedChunks

Whether to split the document into chunks with a model rather than by fixed size.

llmGeneratedQ

When enabled, an LLM will be used to generate a question based on the document context and specific chunk, then prepend it to the chunk. This enhances retrieval by aligning chunks with potential user queries.

llmContentSummarization

When enabled, an LLM summarizes and rewrites the content, removing unnecessary information and focusing on important parts to optimize for retrieval. Limited to 15 rows per table upload.

llmPrependContext

When enabled, an LLM generates a context summary based on the document and chunk context, and prepends it to each chunk. This improves retrieval by providing additional context to each chunk. Note: If both llmGeneratedQ and llmPrependContext are set to true, llmGeneratedQ takes precedence, and the context summarization will not be applied.

Body

multipart/form-data
file
file
required
url
string

An optional source URL to associate with the uploaded document.

canEdit
boolean
default:false

If true, the document content can be edited in the Creator after upload.

metadata
string

A JSON-encoded array of { key, values } metadata tags attached to the document, used to filter knowledge base retrieval at runtime.

Response

201 - application/json

Returns the document created from the supplied text, with its assigned ID, its status, and the smart chunking settings the query parameters selected.

document
object
required