Upload a replacement file

Last updated October 5, 2020

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

Method Details

HTTP Methods:

POST

Content Type:

multipart/form-data

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing & CRM

Required Scope:

files

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
access
(enum)
Required field. Options are:

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

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

PRIVATE
The file will be private and requires a signed url to access. Search engines will NOT be able to index the file.
ttl
(string)
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.