There's a new version of the HubSpot API

We're also working on a new documentation website, you're invited to check it out and give us your feedback.

Upload a new file

Last updated May 15, 2023

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 private app access token Authorization: Bearer {token} header 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. This is an optional field. If specified, the file will be permanently deleted after the specified amount of time. After deletion, the file cannot be recovered or restored.

The formats represent periods. For example “P3M” means a period of 3 months. The file will be deleted after 3 months. The limit for ttl is 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