/files/uploadUpload File
Available for: Chatflow, Workflow, Agent, Chatbot, Legacy Agent, Text Generator apps.
Uploads a file and returns its id for later requests to reference. The file belongs to the uploading end user: only requests carrying the same user can reference it.
Which file types an app actually consumes depends on its file-upload settings; read them from Get App Parameters.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
File upload request. Requires multipart/form-data.
5 documented failures
file_extension_blockedThe file extension is blocked for security reasons.
file_extension_blocked
filename_not_exists_errorThe specified filename does not exist.
filename_not_exists_error
invalid_paramFilename contains invalid characters
invalid_param
no_file_uploadedPlease upload your file.
no_file_uploaded
too_many_filesOnly one file is allowed.
too_many_files
One documented failure
file_too_largefile_too_large
One documented failure
unsupported_file_typeFile type not allowed.
unsupported_file_type
A 400 is returned: - no_file_uploaded : No file was provided in the request.
too_many_files: Only one file is allowed per request.filename_not_exists_error: The uploaded file has no filename.invalid_param: The filename contains/or\.file_extension_blocked: The file's extension is on the deployment's security blacklist (see thefilefield). A 413 is returned:file_too_large: The file exceeds its category's size limit (see thefilefield). The runtimemessageis currently returned as an empty string (a known backend quirk); rely on thecodeand status. A 415 is returned:unsupported_file_type: The uploadedfilepart declares no MIME type.