Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

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

dataset_id
string<uuid>
required

Knowledge base ID. From List Knowledge Bases.

Body

multipart/form-data
file
file
required

File to upload, capped at 15 MB by default.

Self-hosted deployments adjust the limit with the UPLOAD_FILE_SIZE_LIMIT environment variable. On Dify Cloud, Professional and Team plans raise the cap to 50 MB.

data
string

JSON string containing configuration. Accepts the same fields as Create Document by Text (indexing_technique, doc_form, doc_language, process_rule, retrieval_model, embedding_model, embedding_model_provider) except name and text.

Example:

"{\"indexing_technique\":\"high_quality\",\"doc_form\":\"text_model\",\"doc_language\":\"English\",\"process_rule\":{\"mode\":\"automatic\"}}"

Response

Document created successfully.

document
object
batch
string

Batch ID for tracking indexing progress.

Last modified on August 10, 2026