Skip to main content
patch/datasets/{dataset_id}/documents/{document_id}
Request example
Response
patch/datasets/{dataset_id}/documents/{document_id}

Authorization

Authorizationstringheaderrequired#

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_idstringrequired#
Knowledge base ID, from List Knowledge Bases. For a scoped key, copy the ID from the Dify URL.
document_idstringrequired#
Document ID. From List Documents.

Body

multipart/form-data
datastring#
JSON string containing configuration. Accepts the same fields as Create Document by Text (doc_form, doc_language, process_rule, retrieval_model, embedding_model, embedding_model_provider) except name and text.
filefile#

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.

Responses

application/json
Document updated successfully.
batchstring#
Batch ID for tracking indexing progress.
documentobject#