Create Document
This method allows you to upload a document to an index.
If the document is accepted by the API, the system will automatically trigger an indexing to process the document and add its document chunks to the index. To check the indexing progress and status, you can use the methods for listing documents or retrieving the document by its ID.
Once the indexing of the uploaded document is complete, only the document metadata and any embedded chunks are stored. The original, uploaded document is deleted.
Note that you can only upload documents to an index for a knowledge base that
was created with data_origin_type=LOCAL_FILES. For details, refer to the method
to Create a new knowledge base.
knowledge_base_id
index_id
{
"file": "string"
}
file
Successful Response
"Document Object"
Name of the original document, if one was provided during indexing.
Link to the original document, if one was available during indexing.
ID of the document.
Object type, which is always document.
Indexing state of the document.
Media type detected for the document.
ID of the Knowledge Dase of the document.
ID of the index.
ID of the data source from which the document originates (if backed by a data source).
Unix timestamp (in seconds) when the document was added to the index.
Unix timestamp (in seconds) when the document was last embedded in the index.
Most recent indexing job affecting this document. Updated once the state of this indexing becomes INDEXED.
Size in bytes of the document.
SHA256 hash of the document.
If set, the document embeddings require an indexing to guarantee they are in sync with any updates from the data source.
Cannot upload a document to knowledge base configured with a data_origin_type=DATA_SOURCES.
Invalid knowledge base ID.
A document with this file name already existsin this knowledge base.
The uploaded file is too large. File size limit is 10.00 MiB.
An empty file or unsupported extra parameters were supplied.
The uploaded file could not be processed.
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: multipart/form-data' -d '{"file:"string"}' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/documents