Hello @JonathanVasquez
Thanks for the using this import file,
When uploading a file (like a PDF) via the HubSpot Files API, the access level defaults to public_indexable, even if the folder is set to private or you try to force a different access level. You must explicitly set the access type after upload using a separate call to change the file’s visibility.
The Files API behaves in two distinct stages:
1. File Upload – This step uploads your file, and it defaults to public_indexable access regardless of folder settings.
2. Patch/Update File Metadata – This is where you can change the visibility to private after upload.
Even if your folder is marked private, the file will still be public_indexable unless you update it explicitly.
How to Set a File to Private (Correct Way)
1. Upload the file using /files/v3/files
2. Capture the file ID from the response
3. Make a PATCH request to /files/v3/files/{fileId} to update access
1. Upload the PDF
POST https://api.hubapi.com/files/v3/files
Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: multipart/form-data
Body:
file: [your PDF file]
options: {
“access”: “private”,
“ttl”: “P3M” // optional
}
2. Update Access Type After Upload
PATCH https://api.hubapi.com/files/v3/files/123456789
Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Body:
{
“access”: “private”
}
Why Folder Settings Don’t Help
The HubSpot folder system is organizational, not hierarchical like a traditional filesystem. Access is controlled per file, so even if you set a folder to private or “make all children private,” newly uploaded files will still default to public unless updated manually.
Using HubSpot’s File Upload Tool
You noticed the community tool or HubSpot UI tool resets the access back to public_indexable — this is a bug or limitation in that tool. It behaves like the API: upload defaults to public unless you override it.
The first step is upload file with ‘/files/v3/files’ this action and its required
The second step is set access to private with ‘PATCH /files/v3/files/{fileId}’ this action and its required
The Rely on folder privacy is does not work.