OAuth, Security, and API Governance for the HubSpot–Salesforce Integration
Published by Bles Software, a custom software and AI company based in Yehud-Monoson, Israel, building web apps, AI agents and API integrations for clients in Israel, the US, the UK and the EU.
Security is not a feature you bolt on to a HubSpot–Salesforce integration; it is a property you design for from day one. The same decisions that keep your data safe also make operations predictable: least‑privilege scopes mean fewer unexpected write failures, a single integration identity creates better audit trails, and change management that treats configuration like code reduces outages. This playbook lays out a practical approach to OAuth, permissioning, and API governance so your integration remains durable as teams, vendors, and requirements evolve.
Why this matters
The integration touches your most sensitive objects: people, companies, deals, activities, and sometimes support cases or subscriptions. Misconfigured scopes, overshared profiles, and ad‑hoc secrets are common root causes of incidents. With a small set of patterns, you can keep secrets rotated, permissions tight, and flows auditable—without slowing the business.
Integration identities and trust boundaries
Create a dedicated, non‑human integration user in Salesforce and a named private app connection in HubSpot. Disable interactive login for the Salesforce user, enforce MFA on admin accounts, and restrict the integration user’s profile to the exact objects and fields the integration needs. Store the connection metadata (client IDs, auth URLs, scopes) in a secure, version‑controlled vault with access limited to platform admins.
Use one identity per integration class. If you run both the native HubSpot connector and a middleware, give each its own integration user and app registration. This isolates blast radius when you troubleshoot or rotate secrets and makes audit logs legible.
OAuth scopes and least privilege
Start with the smallest set of scopes that allow your intended operations and grow only when you add explicit, reviewed features. In HubSpot, align scopes to the properties you read and write; in Salesforce, mirror that discipline with object and field‑level permissions. Keep a living field map that annotates authority (HubSpot vs. Salesforce), direction (create, update), and justification (“needed for routing,” “used in attribution”). When someone proposes a new write, they must add a line to that map.
Scopes are not static. Review quarterly: remove obsolete writes and reads that no longer serve a purpose. Each reduction lowers risk, accelerates troubleshooting, and often reduces limit consumption.
Profiles, permission sets, and field access
In Salesforce, avoid the trap of giving the integration user “god mode” because it is easier in the moment. Use a custom profile with no more than the necessary object permissions (CRUD) and field‑level security that exposes only mapped properties. Where ad‑hoc exceptions emerge, prefer temporary permission sets with an expiration rather than bloating the base profile.
For HubSpot, bias toward property‑level writes gated by inclusion lists and workflows that compute sensitive outputs instead of allowing direct writes. Preserve the integration’s ability to read history where needed for reconciliation, but mask or avoid storing fields that serve no operational use.
Secrets management and rotation
No shared spreadsheets. Store client secrets and refresh tokens in a managed secret store and inject them at runtime. Enforce rotation policies: when staff change roles, rotate; when you add new scopes, rotate; at least quarterly, rotate anyway. Test rotations in a sandbox first, and maintain a short runbook for rollback in case a rotation uncovers hidden dependencies.
Change management like code
Configuration drifts quietly. Export integration settings, field maps, and list definitions on a schedule and diff them in a repository. A small configuration README that explains how to add a field, how to request a new scope, and how to validate a change cuts incident rates dramatically. Treat approvals as checklists: impact assessment, test plan, rollback, and monitoring plan.
Auditing and incident response
When something goes wrong, you need lineage fast: which app, which identity, which field, which record, when. Keep logs in three places: the source system (HubSpot), the destination (Salesforce), and a centralized log sink if you operate a middleware. For sensitive objects, add minimal, human‑readable breadcrumbs (“Integration updated Lifecycle Stage from X to Y due to rule Z”). In incident review, classify causes into a small taxonomy (scope, permission, validation, mapping, transient) and track time to detect and time to repair. Small, consistent post‑incident notes build organizational memory.
API limits and polite integration
Security is not only about who may do what—it is also about pacing. A polite integration respects limits and other tenants on the platform. Prefer push over pull where available: HubSpot property change hooks and Salesforce Platform Events reduce scanning and lower read traffic. When you must poll, use narrow windows keyed to SystemModstamp and cache cursors so restarts do not trigger replays.
Design writes to be idempotent and small. Batch where supported, but never at the expense of observability. A failed batch that contains five different error classes is hard to triage. Write thin, frequent batches with a stable key (external ID) and record individual outcomes.
Data minimization and masking
Only sync PII that your process needs. For analytics, push aggregates to the warehouse rather than mirroring raw payloads broadly. Mask fields in non‑production environments and avoid export pipelines that move full snapshots to laptops. If a team cannot articulate why they need a field, they do not need it.
Third‑party apps and layered trust
Many organizations add enrichment, sales engagement, or scheduling tools to the mix. Each new app is a new trust boundary and a new potential path to change a field the integration relies on. Maintain a short registry of connected apps with the specific objects and fields they can write, the reason, and the owner. When incidents occur, this registry speeds triage.
Rollout checklist
Roll out governance in calm steps:
- Create or harden the integration identities. Disable interactive logins and audit recent access.
- Inventory field writes. Mark each as required or optional with a reason.
- Right‑size scopes and permissions. Test in sandbox; rotate secrets.
- Wire diff‑able configuration exports and log sinks. Practice an incident.
- Publish a one‑page runbook: how to request changes, who approves, how to roll back.
FAQ
Should the integration user own records?
No. Ownership has human semantics. Use queues and assignment rules for routing. The integration user should create and update, not own, unless there is a temporary exception for backfills.
How do we grant temporary access for a one‑time operation?
Use a time‑boxed permission set that expires automatically. Document the reason and the records touched. After the task, run a small reconciliation to ensure the changes match intent.
What is the right cadence for scope reviews?
Quarterly is a good default, with an ad‑hoc review whenever you add a new object or process. Tie the review to configuration exports so you can see what changed and why.
How do we prevent shadow integrations?
Lock down app registrations to platform admins, and set a naming convention for all approved apps. Monitor new connected apps weekly and investigate surprises quickly. Education matters: make it easy to request legitimate integrations so teams do not feel compelled to bypass the process.
Can we rely on audit logs during incidents?
Yes, but only if you design for it. Test your ability to reconstruct a change from logs once a quarter. If you cannot answer “who changed what and why” in five minutes, add the missing breadcrumb or export.
More RevOps Playbooks from Bles Software
- Attribution & Pipeline Reporting Setup | Bles Software
- Data Mapping Checklist (Leads/Contacts/Opportunities) | Bles Software
- Field Governance & Picklists | Bles Software
- Sync Rules: Deduping, Owners, Lifecycle | Bles Software
- HubSpot ↔ QuickBooks Integration Playbook | Bles Software
- Errors & Retries: Top Fixes | Bles Software
- HubSpot ↔ Salesforce Integration: Executive Guide | Bles Software
- HubSpot ↔ Salesforce: Cost & Timeline Drivers | Bles Software
- Daily AI Roundup: AI agent, model and enterprise AI news