Convert a private PDF link into a public URL

The system snippet calls the HubSpot Files API for a signed URL and returns it as an output you can email or send onward.

The challenge

Files uploaded to HubSpot are private by default. When a workflow needs to email a quote or push a document to another system, the stored link fails for anyone outside the portal, so teams fall back to downloading the file and re-uploading it somewhere public.

How AuPerate solves it

Run Custom Code calls HubSpot's own Files API from inside the workflow and returns a time-limited signed URL as an output. The document never leaves HubSpot and the link expires on its own.

How to build it
  1. 1Clone the PDF system snippet from the snippet library into your own snippets.
  2. 2Add a HubSpot private app token with files scope as a secret named HUBSPOT_TOKEN.
  3. 3Add Run Custom Code to your workflow, select the cloned snippet, and pass the file URL or file ID as Input 1.
  4. 4Use Output 1, the signed public URL, in a following email or Send Webhook step.
What the action gives you
  • Saved, versioned snippets or inline code
  • Encrypted secrets injected as secrets.KEY
  • axios, lodash, dayjs, crypto and form-data available
  • Console output captured for debugging

Build this in your own workflows

Install AuPerate once and every action appears in your HubSpot workflow editor.

Get Started