There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API Keys are being deprecated and are no longer supported. Continued use of HubSpot API Keys is a security risk to your account and data. Your API Keys could be deactivated at any time after Nov. 30th, and we recommend that you migrate to Private Apps as soon as possible so you do not lose business-critical functionality.

Upload a replacement file

Last updated March 10, 2021

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