Skip to main content
post/datasets/{dataset_id}/documents/{document_id}/update-by-text
Request example
Response
post/datasets/{dataset_id}/documents/{document_id}/update-by-text

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

application/json
doc_formenum<string>#
text_model for standard text chunking, hierarchical_model for parent-child chunk structure, qa_model for question-answer pair extraction.

Default: "text_model"

Options:text_modelhierarchical_modelqa_model
doc_languagestring#
Language of the document for processing optimization.

Default: "English"

namestring#
Document name. Required when text is provided.
process_ruleobject#
Processing rules for chunking.
retrieval_modelobject#
textstring#
Document text content.

Responses

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