/datasets/{dataset_id}/documents/{document_id}/update-by-textUpdate document content or processing configuration
Updates a document's text, name, or processing and retrieval configuration. Supply text to replace the document content and name when you provide text; select processing and retrieval options as needed. Text changes trigger re-indexing, and the response includes a batch ID for tracking indexing progress.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Document content and optional processing and retrieval configuration. Provide name when supplying text; process_rule requires mode, and retrieval_model requires search_method, reranking_enable, top_k, and `score_threshold_enabled.
2 documented failures
invalid_paramname is required when text is provided.
invalid_param (name required)
provider_not_initializeNo valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.
provider_not_initialize
One documented failure
forbiddenDataset api access is not enabled.
forbidden (api access)
One documented failure
not_foundDataset not found.
not_found
One documented failure
service_unavailableUnable to verify vector space usage right now. Please try again later.
service_unavailable
A 400 is returned when the document is unavailable for update, doc_form is invalid, or name is missing when text is supplied; a 403 indicates that API access, subscription limits, or API-key scope prevent the operation; a 404 indicates that the knowledge base or document was not found; a 503 indicates that vector space usage could not be verified on the Dify Cloud Sandbox plan. The dataset_id path parameter and document_id path parameter must identify the knowledge base and document to update. doc_form must be text_model, hierarchical_model, or qa_model; process_rule.mode must be automatic, custom, or hierarchical; and retrieval_model.search_method must be keyword_search, semantic_search, full_text_search, or hybrid_search.