Issue
Customers using Segment’s HubSpot Cloud-Mode Actions destination may encounter the error 401 EXPIRED_AUTHENTICATION with the message:
The OAuth token used to make this call expired X hour(s) ago.This typically occurs when Segment attempts to send data to HubSpot using an expired access token.
Product
Twilio Segment
Environment
Segment Console
Cause
This issue occurs when the OAuth access token for HubSpot expires and Segment does not successfully refresh it using the stored refresh token. This can happen if the refresh token is missing, invalid, or not being used correctly by Segment’s OAuth flow.
Resolution
To resolve this issue, follow these steps:
- Go to your HubSpot Cloud-Mode Actions destination in the Segment Console.
- Reauthorize the HubSpot connection from the destination’s configuration page. Ensure you are logged in as a HubSpot super admin.
- After reauthorizing, resend a test event or trigger a regular event to confirm successful delivery.
- If the error persists, check that the refresh token is present and valid in the destination settings.
- If you continue to experience issues, collect error details (frequency, context, logs) and contact support for further investigation.
Additional Information
- OAuth access tokens expire periodically for security reasons. Segment is designed to automatically refresh tokens using the stored refresh token.
- If you see this error repeatedly, it may indicate a problem with the refresh token or the authorization flow.
- Keeping your HubSpot connection up to date and ensuring the correct permissions can help prevent authentication issues.