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.

Update the access of a group of files in file manager

Last updated May 31, 2023

POST /filemanager/api/v3/files/set-access/batch

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Marketing & CRM

Required Scope:

files

Updates the access settings for a set of files.

The files can be specified by individual file IDs, or by folder ID. When a folder ID is used, all of the files in the folder and subfolder will have their access setting updated.

The updates are processed asynchronously. The response will include a taskId that can be used to to check the status of the task. See this documentation for details on checking the task status.

Note: This endpoint will not update the settings for folders, only the individual files contained in those folders and any subfolders. Future files added to these folders will not be affected.
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 access "access":"{setting}"
Used in request body

The access setting that you want to use for the files.
Must be one of:

  • 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. Search engines will NOT be able 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.

Note: at least one of folderIds or fileIds must be included.

Optional Parameters How to use Description
Folder IDs "folderIds":[]
Used in the request body
A list of IDs corresponding to folders in the file manager. See this document for getting the folder details.
File IDs "fileIds":[]
Used in the request body
A list of IDs corresponding to files in file manager. See this document for getting file details.

 

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