Skip to main content
POST
cURL

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).

Body

multipart/form-data
file
file
required

The file to upload, as one multipart/form-data part. Document files are capped at 15 MB by default.

Self-hosted deployments adjust the limit with the UPLOAD_FILE_SIZE_LIMIT environment variable.

On Dify Cloud, Professional and Team plans raise the document cap to 50 MB. Images, audio, and video follow their own limits: 10 MB, 50 MB, and 100 MB by default.

Response

File uploaded successfully.

id
string

Unique identifier of the uploaded file.

name
string

Original file name.

size
integer

File size in bytes.

extension
string

File extension.

mime_type
string | null

MIME type of the file. May be null if the upload did not include one.

created_by
string

ID of the user who uploaded the file.

created_at
string | null

Upload timestamp in ISO 8601 format. May be null while the record is being created.

Last modified on August 10, 2026