Skip to main content
GET
Get Document File

Authorizations

Authorization
string
header
required

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_id
string<uuid>
required

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
string<uuid>
required

Document file ID. From List Document Files.

Response

The document file.

created_at
string

When the file was stored, ISO 8601.

filename
string

Original file name.

id
string

Document file ID. Different from the document ID in the address bar of the open document in Dify.

knowledge_space_id
string

Internal ID of the knowledge base. Not the knowledge base ID in the path.

metadata
object

Metadata recorded with the file when it was uploaded or imported.

mime_type
string

MIME type of the file.

object_key
string

Key of the file in object storage. No operation in this API returns the file's content.

parser_status
string

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.

sha256
string

SHA-256 hash of the file content, hex-encoded.

size_bytes
integer

File size in bytes.

source_id
string | null

ID of the source the file was imported from. null for uploaded files.

updated_at
string | null

When the file record last changed, ISO 8601. null when it has not changed since creation.

version
integer

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.