Get Document File
Returns one document file: the stored file behind a document, with its
version and parser_status.1 min read
get/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_file_id}
Request example
Response
get/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_file_id}
Authorization
Path parameters
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (
…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.Document file ID. From List Document Files.
Responses
application/json
The document file.
When the file was stored, ISO 8601.
Original file name.
Document file ID. Different from the document ID in the address bar of the open document in Dify.
Internal ID of the knowledge base. Not the knowledge base ID in the path.
Metadata recorded with the file when it was uploaded or imported.
MIME type of the file.
Key of the file in object storage. No operation in this API returns the file's content.
Parse state of this version of the file:
pending, parsed, or failed. Parsing is one step of indexing. A parsed file can still have no outline and no chunks.SHA-256 hash of the file content, hex-encoded.
File size in bytes.
ID of the source the file was imported from.
null for uploaded files.When the file record last changed, ISO 8601.
null when it has not changed since creation.Always
1 for this file ID. A content update, including a source sync, creates a different file ID rather than incrementing this value. This is separate from the document's content revision. Send it as expectedRevision to Delete Document File.