Skip to main content
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

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

knowledge_base_idstringrequired#
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_idstringrequired#
Document file ID. From List Document Files.

Responses

application/json
The document file.
created_atstring#
When the file was stored, ISO 8601.
filenamestring#
Original file name.
idstring#
Document file ID. Different from the document ID in the address bar of the open document in Dify.
knowledge_space_idstring#
Internal ID of the knowledge base. Not the knowledge base ID in the path.
metadataobject#
Metadata recorded with the file when it was uploaded or imported.
mime_typestring#
MIME type of the file.
object_keystring#
Key of the file in object storage. No operation in this API returns the file's content.
parser_statusstring#
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.
sha256string#
SHA-256 hash of the file content, hex-encoded.
size_bytesinteger#
File size in bytes.
source_idstring#
ID of the source the file was imported from. null for uploaded files.
updated_atstring#
When the file record last changed, ISO 8601. null when it has not changed since creation.
versioninteger#
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.