HubSpot Setup
Create a HubSpot app for CRM, marketing, and sales automation.
Setup Steps
Section titled “Setup Steps”-
Create HubSpot Developer Account
Sign up at HubSpot Developers.
-
Create an App
In your developer account, go to “Apps” and create a new app.
-
Configure OAuth Settings
In the Auth tab, add the redirect URL:
https://api.switchboard.fpdigital.ai/oauth/hubspot/callback -
Select Scopes
Add the required scopes for CRM and marketing access:
crm.objects.contacts.readcrm.objects.contacts.writecrm.objects.companies.readcrm.objects.companies.writecrm.objects.deals.readcrm.objects.deals.write -
Get Client Credentials
Copy the Client ID and Client Secret from the Auth tab.
-
Create Test Portal (Optional)
Create a test portal for development and testing before connecting production accounts.
Environment Variables
Section titled “Environment Variables”npx wrangler secret put HUBSPOT_CLIENT_IDnpx wrangler secret put HUBSPOT_CLIENT_SECRET| Variable | Description |
|---|---|
HUBSPOT_CLIENT_ID | OAuth Client ID from HubSpot App settings |
HUBSPOT_CLIENT_SECRET | OAuth Client Secret from HubSpot App settings |
Redirect URI
Section titled “Redirect URI”https://api.switchboard.fpdigital.ai/oauth/hubspot/callbackImportant Notes
Section titled “Important Notes”- Test with a sandbox portal before connecting production data
- API rate limits vary by subscription tier
- Contact, Company, and Deal objects are available on all plans
Common Issues
Section titled “Common Issues”- Rate limits: HubSpot rate limits vary by tier (100 calls/10s for free, 150 for Starter, 200 for Pro/Enterprise). Switchboard handles retry automatically.
- Record IDs: HubSpot uses numeric string IDs (e.g., “12345”), not integers. Always pass IDs as strings.
- Association types: Linking contacts to companies/deals requires association type IDs. Common types: contact_to_company (1), contact_to_deal (3).
- Custom properties: Custom properties must be created in HubSpot before they can be set via the API.
Testing
Section titled “Testing”- Create a test portal at HubSpot Developer Sandbox
- Connect using test portal credentials
- Click Test Connection to verify
- Try: “List my HubSpot contacts” or “Create a new contact”