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 replacement file

Last updated May 31, 2023

POST /filemanager/api/v3/files/:file_id/replace

Method Details

HTTP Methods:


Content Type:


Response Format:


Requires Authentication?


Rate Limited?





Marketing & CRM

Required Scope:


Replace a specific file in file manager, specified by the file ID.

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.
file_id Used in the request URL Unique identifier for a particular file

Allowed Fields in the body

Parameter name Type Description
file File data The multi-part form encoded file to upload.
charSetHunch String Optional field. The character set of the provided file.
options JSON object 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.