Keys / HubSpot
HUBSPOT_ACCESS_TOKEN
The token your app calls HubSpot's REST APIs with: a service key, or the access token of a legacy private app. It's limited to the scopes you pick.
- Starts with
pat-- Expires
- the docs don't say
- API
- none; HubSpot account only
Get it
Create one on app.hubspot.com. The steps aren't recorded yet.
Set it
HUBSPOT_ACCESS_TOKEN=pat-...
The Node.js and Python client libraries don't read it; your app passes it as accessToken or access_token. HubSpot's @hubspot/local-dev-lib reads it when USE_ENVIRONMENT_HUBSPOT_CONFIG is true. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- In HubSpot, go to Development > Keys > Service keys, open the key and click Rotate > Rotate and expire later. For a legacy private app, use Rotate on its Auth tab.
- Deploy the new key everywhere that reads
HUBSPOT_ACCESS_TOKEN. The old key expires in 7 days. - Check that nothing still uses the old key. Click Expire now to end it sooner, or Cancel rotation to keep it and revoke the new one.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.
Sources, checked 2026-11-16
- HubSpot: Make API requests using a service key
- HubSpot: Legacy private apps
- HubSpot changelog: legacy private app creation disabled
- HubSpot API reference index
- hubspot-api-nodejs: the token is `accessToken`
- hubspot-api-python: the token is `access_token`
- hubspot-local-dev-lib: reads HUBSPOT_ACCESS_TOKEN