/datasets/{dataset_id}/documents/{document_id}Update Document
Updates a document by uploading a new file, then re-indexes it. This is the canonical endpoint for file-based document updates. Track progress with the returned batch ID via Get Document Indexing Status.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
4 documented failures
filename_not_exists_errorThe specified filename does not exist.
filename_not_exists_error
invalid_paramDocument is not available
invalid_param (not available)
provider_not_initializeNo valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.
provider_not_initialize
too_many_filesOnly one file is allowed.
too_many_files
One documented failure
forbiddenDataset api access is not enabled.
forbidden (api access)
One documented failure
not_foundDataset not found.
not_found
One documented failure
file_too_largeFile size exceeded.
file_too_large
One documented failure
unsupported_file_typeFile type not allowed.
unsupported_file_type
One documented failure
service_unavailableUnable to verify vector space usage right now. Please try again later.
service_unavailable
A 400 is returned: - too_many_files : Only one file is allowed per request.
filename_not_exists_error: The uploaded file has no filename.provider_not_initialize: No model provider credentials are configured for the workspace.invalid_param: The document is not available for update (only available documents can be updated). A 403 is returned: -forbidden: Knowledge base API access is not enabled.forbidden: The capacity of the vector space has reached the limit of your subscription.forbidden: Sorry, you have reached the knowledge base request rate limit of your subscription.forbidden: The API key is scoped to specific knowledge bases, and this knowledge base is not one of them. A 404 is returned: -not_found: Knowledge base not found.not_found: Document not found. A 413 is returned:file_too_large: The uploaded file exceeds the maximum size. A 415 is returned:unsupported_file_type: The uploaded file's type is not supported. A 503 is returned:service_unavailable: Vector space usage could not be verified. Returned on the Dify Cloud Sandbox plan only; retry the request later.