Jun 5, 202510:10 AM - edited Jun 5, 202510:17 AM
Participant
Form Submission Files
SOLVE
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.
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"
Jun 10, 20258:58 AM - edited Jun 10, 20258:59 AM
Participant
Form Submission Files
SOLVE
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:
Extract the file ID from the signed URL (after /signed-url-redirect/).
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.
Jun 10, 20258:58 AM - edited Jun 10, 20258:59 AM
Participant
Form Submission Files
SOLVE
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:
Extract the file ID from the signed URL (after /signed-url-redirect/).
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!
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"
Jun 10, 20255:31 AM - edited Jun 10, 20255:34 AM
Participant
Form Submission Files
SOLVE
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.