Upload a new file

Last updated January 6, 2021

POST /filemanager/api/v3/files/upload

Method Details

HTTP Methods:


Content Type:


Response Format:


Requires Authentication?


Rate Limited?





Marketing & CRM

Required Scope:


Upload a new file to the file manager. This endpoint uses multi-part form encoding, rather than JSON.

On success, the response will include the metadata for the file.  See this page for an example.

Required Parameters How to use Description
OAuth Access Token or API Key Authorization: Bearer {token} header
or hapikey={key} query parameter.
Used to authenticate the request. Please see this page for more details about authentication.

Allowed Fields in the body

Parameter name Type Description
fileName string Optional field. Desired name of the file. If not provided the name will be inferred from the file data.
file File data The multi-part form encoded file to upload.
folderPath string Partially optional field. One of folderPath or folderId must be specified. Path of the folder the file should be uploaded into. Uploading files into the root path “/” is highly discouraged.
folderId string Partially optional field. One of folderId or folderPath must be specified. Id of the folder the file should be uploaded into.
charsetHunch string Optional field. The character set of the provided file.
options JSON string Required field. JSON string representation of the options object. See below.

options object

Field name Description
Required field. Options are:

The file will be publicly accessible by anyone who has the file url. Search engines will be able to index the file.

The file will be publicly accessible by anyone who has the file url. The X-Robots-Tag: noindex header will be sent whenever the file is retreived, instructing search engines not to index the file.

The file will be private and requires a signed url to access. Search engines will NOT be able to index the file.
Time to live. Optional field. If specified the file will be deleted after the specified amount of time. The formats are Periods. For example “P3M” means a period of 3 monts. The file will be deleted after 3 months. The ttl cannot be more than 1 year.
If true this file with replace any existing files with the name name, folder, and type.

Note: If this is set to false, and the uploaded file matches the filename of an existing file in the same folder, the file will be uploaded with a number incremented filename (e.g. example_file.txt will become example_file-1.txt)
Optional field. Options are:

If a duplicate file is found, the upload request is rejected.

If a duplicate file is found, the upload is cancelled and the existing file is returned instead.

No duplicate file validation is performed.

Defaults to NONE if not specified
Optional field. Options are:

Checks all files for a duplicate.

Checks only the provided folder for a duplicate.

Defaults to EXACT_FOLDER if not specified

These code samples use a demo API key. Using this key for anything but GET requests will result in an error. For all other requests (such as POST or PUT), you'll need to use your own API key or OAuth. For more details, please see here