Skip to main content

HubSpot

Use HubSpot for CRM workflows such as lead capture, contact enrichment, deal tracking, customer onboarding, and sales activity sync.

Example app: pipeline health dashboard

Build a HubSpot deal monitoring app.
Show deals by pipeline stage, health score, next step, owner, and last activity.
Highlight stalled deals and overdue tasks.
Allow admins to update next steps and create follow-up tasks.
Use HubSpot OAuth or a private app token, and store tokens server-side.

Decide the sync direction

DirectionExample
App to HubSpotA new lead form creates a HubSpot contact.
HubSpot to appA deal status change updates the app dashboard.
Two-way syncContacts and deal fields stay aligned across both systems.
HubSpot developer app dashboard
Create a private app or OAuth app for the Cocoding AI project.
HubSpot app scopes screen
Give the app only the CRM scopes it needs.
HubSpot API access screen
Keep HubSpot access tokens in server-side configuration.
HUBSPOT_ACCESS_TOKEN=
HUBSPOT_PORTAL_ID=
HUBSPOT_WEBHOOK_SECRET=

For OAuth apps, use:

HUBSPOT_CLIENT_ID=
HUBSPOT_CLIENT_SECRET=
HUBSPOT_REDIRECT_URI=
HUBSPOT_ENCRYPTION_KEY=

Prompt Cocoding AI

Add HubSpot lead sync.
When a lead is submitted, create or update a HubSpot contact.
Map fields: email, first name, last name, company, lifecycle stage.
Use HUBSPOT_ACCESS_TOKEN on the server.
Show sync status and the latest HubSpot error in the admin dashboard.

Test CRM sync

  1. Use a test contact.
  2. Submit the lead form from the preview.
  3. Confirm the HubSpot contact is created or updated.
  4. Change a field and repeat the sync.
  5. Confirm duplicates are avoided by matching on email or another stable identifier.

HubSpot app setup

  1. Open HubSpot developer tools.
  2. Create a public app for OAuth or a private app for a single workspace.
  3. Add only the CRM scopes your generated app needs.
  4. Configure redirect URLs when using OAuth.
  5. Copy internal property names for contacts, companies, deals, and tasks.
  6. Store tokens and client secrets server-side.

Suggested data mapping

Cocoding AI fieldHubSpot object
Lead emailContact email
Company nameCompany name
Deal amountDeal amount
Deal stagePipeline stage
Follow-up dateTask due date
NotesEngagement or note body

Troubleshooting

SymptomLikely causeWhat to check
Contact not createdMissing CRM scopeAdd the required contact scope.
Duplicate contactsNo stable match keyAsk Cocoding AI to upsert by email.
Field ignoredHubSpot property name mismatchCopy the internal property name from HubSpot.
Sync loopsTwo-way updates not guardedAdd source tracking and last-updated checks.