At this time, it is not possible to change a file from "hidden": true to "hidden": false, or vice versa, as indicated in this article. I am sorry if this comes as an unwelcome surprise.
One way to prevent files from being hidden is to upload them to HubSpot's file manager before attaching them to an engagement. See this screencast.
That said, if the following:
Use this Engagements API endpoint to retrieve engagements on a CRM object, locate file IDs in various engagements' attachments arrays, query this endpoint with the file IDs, and find that the URLs in the url fields led to 404 error pages?
isn't the steps you took, do you mind sharing with me more details on the steps you took? As well as the following:
On my end, I'm able to see that file id 26317599351 is set to hidden: true as such we wouldn't be able to access this file via the public file URL.
Moving forward, if you'd like to prevent file from being hidden: true, your team would need to upload the file into your file manager first before attaching it onto your HubSpot object (e.g. ticket/contact).
Let me know if you'd need further clarification on this!
Thank you for clarification. Is there any other way to get such files, maybe not through the links. Can you somehow retrieve the contents of a file that is hidden: true?