hubspot-refresh-token
Refresh HubSpot OAuth access tokens when API requests fail due to expiration. Automates token renewal and updates process.env.PRIVATE_APP_ACCESS_TOKEN. Use only for OAuth when REFRESH_TOKEN is available and avoid multiple invocations per session.
Instructions
🔄 Refreshes the HubSpot OAuth access token using the refresh token from environment variables.
🎯 Purpose:
- Use only when HubSpot API requests fail due to expired tokens.
- Automatically refreshes and sets the active access token in process.env.PRIVATE_APP_ACCESS_TOKEN.
- Not required for long-lived Private App tokens.
🛡️ Guardrails:
- Only use if using OAuth (i.e. REFRESH_TOKEN is present in environment).
- Do not invoke more than once per session unless a 401 Unauthorized response is received from HubSpot API.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
No arguments |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}