Form Submission Files

Hi Everyone!

Is there currently a way how I could achive to retreive files which are stored in a contact property with an api call?
The problem is this:
We get new contacts after clients submit a form. Within this form they also upload documents. These documents should be processed externally with an automation I am building. However when I get the contact properties which contain the files, I am only getting a signed url, which I cant use to download the documents.

As far as I know, the files are also not accessible via the files api, because their origin is the submission form.

Hi @MalteKupzok,

When setting up a file property, you can select whether the file is public or private. This ultimately controls the access for the file that was uploaded through the form

I assume your file property is set to “Private” and by changing it to “Public”, you should be able to retrieve a link that would allow accessing the file directly.

If you need to keep it private, then to access a file that was uploaded to a form, you will need to perform a few API calls and add some logic in between :

1) GET Contact and retrieve the value of the file property

2) The file property uploaded through a form will be a URL, so you will need to use some logic to extract the ID of that file

In this case it would be the number after “/signed-url-redirect/”, the number “123456789”

https://api-na1.hubspot.com/form-integrations/v1/uploaded-files/signed-url-redirect/123456789?portalId=........etc....

3) Use the extracted ID to make a call to Get signed URL endpoint that will create a temporary link to publicly access the file

Hope this helps!

Thank you for the reply! I extracted the file ID and I was able to download the file with a short script. However the pdf files or image files are corrupted. They dont contain any information.

The property rules allow everyone to view and edit the property. I also changed the file from being private to being available publicy. But still the files are corrupted.
Thank you for the help so far! :slightly_smiling_face:

What if the form field (Image) is Sensitive in HubSpot ? As i am still couldn’t able to access the file using signed URL https://api.hubapi.com/files/v3/files/337709149882/signed-url.

“status”: “error”,

“message”: “Cannot access sensitive file”,

“correlationId”: “019dcad4-81b8-7c8c-8e57-d5c553f041dc”,

“category”: “FORBIDDEN”

Will sensitive field will have the same problem ? if anyone has encountered the same issue or any solution will be much appreciated.
Thanks,

Hi @JH75,
Thank you for posting to the Community! I’d like to tag in @evaldas since they were able to provide the Accepted Solution of this thread! Hi @evaldas do you have any insight into the “Forbidden” error that @JH75 is receiving?
Thank you in advance!
Cassie, Community Manager

The endpoint for getting a singed URL is only available for “private” files at the moment.

For sensitive files, you can only retrieve the internal file ID value via the API, which could then be used to create an internal link. That link can be viewed only by someone with a HubSpot account in the portal.

Hope this helps!

Thanks, @evaldas . The objective is to retrieve the file via API, convert it into a byte stream, and process it within another system. This integration will be fully backend-driven and will not involve any portal or user interface for viewing the file. Appreciate if you have any suggestion or guidance to achieve the same.

Sure thing @JH75. In this case, if you want to build this integration, you would need to use private files instead of sensitive files, as there does not appear to be any option to obtain sensitive files via the API at the moment.

You can also submit your use case to the HubSpot developer feedback form for consideration, but it will not guarantee that this will change.

Thanks @evaldas, will definetly post my feedback into developer form. meantime i will ask the Hubspot team to change the field from sensitive to regular.

Hi everyone, I’ve found a working solution and wanted to share it here in case others face the same issue. This will work for private and non-private files.

The problem was that the file URLs returned in the contact properties are signed redirect links (e.g. /signed-url-redirect/:fileId?..), which can’t be directly downloaded via requests.get() or similar methods. They often return corrupted files (e.g. .bin) or incomplete content.

Solution:

Instead of using the redirect URLs directly, I used the HubSpot v3 Files API to programmatically request a proper signed download URL using the file ID.

Here’s how it works:

  1. Extract the file ID from the signed URL (after /signed-url-redirect/).
  2. Use this endpoint to get a fresh signed URL:

GET https://api.hubapi.com/files/v3/files/{fileId}/signed-url

  1. Download the file from the signed URL using requests.get(…, stream=True), making sure to handle binary data and preserve the file extension based on headers or the URL.

Why this works:

The v3 Files API bypasses the redirect logic and gives you a direct, reliable download link that can be used in automations and server scripts.

Thanks to the community for pointing me in the right direction!

@MalteKupzok When a file is uploaded through a form, the contact property will only return a signed URL. That URL can be used to download the document, but it’s time-limited for security reasons, so you need to fetch it and process the file while the link is still valid.

These files don’t appear in the Files API because they’re stored differently, but the signed URL is the correct way to access them. A common approach is to have your automation call the contact property, grab the signed URL, immediately download the file contents, and then move it into your own storage or processing pipeline.