Documents
Create Document by File
Changed onCreates a document in a knowledge base from an uploaded file. Common formats such as PDF, TXT, and DOCX are supported. Indexing runs asynchronously; track it with the returned batch ID via Get Document Indexing Status.
post/datasets/{dataset_id}/document/create-by-file
Request
- Base URLhttps://api.dify.ai/v1
- URLhttps://api.dify.ai/v1/datasets/{dataset_id}/document/create-by-file
- AuthHTTP bearer
Path parameters
dataset_idstring uuid required
Knowledge base ID, from List Knowledge Bases. For a scoped key, copy the ID from the Dify URL.
Request body multipart/form-data
Example request
{
"data": "{\"indexing_technique\":\"high_quality\",\"doc_form\":\"text_model\",\"doc_language\":\"English\",\"process_rule\":{\"mode\":\"automatic\"}}"
}Response
Document created successfully.
Changes
- info
added the non-success response with the status
- info
- info
added the non-success response with the status
- info