.png)

HubSpot Marketing Hub Integration Guide
Connect HubSpot Marketing Hub with enterprise systems through REST APIs, selected webhooks, batch imports, files, and secure OAuth or private app authentication.
HubSpot Marketing Hub integration options at a glance
HubSpot Marketing Hub is primarily integrated through its versioned REST APIs, which cover CRM objects, associations, properties, search, forms, marketing email, lists, files, imports, and related services. Selected CRM and application events can be delivered through HubSpot webhooks, although coverage varies by object, event, subscription, and account. Batch endpoints and import APIs support larger data loads, while the Files API supports file management. Martini can consume these endpoints, receive supported webhook notifications, schedule incremental synchronization, map HubSpot JSON into enterprise models, apply consent and business rules, and expose controlled APIs for downstream applications. OAuth 2.0 and private app access tokens provide the principal authentication options.
Common HubSpot Marketing Hub integration patterns
Common HubSpot Marketing Hub data objects used in integrations
Authentication and security considerations
Use OAuth 2.0 or private app tokens
Use OAuth 2.0 when the integration must connect to multiple HubSpot accounts or obtain administrator consent. Use a private app access token for a controlled integration tied to one known account. Legacy API keys are not appropriate for new implementations.
Protect credentials and scopes
- Store access tokens, refresh tokens, and private app tokens in Martini secrets.
- Request only the scopes required by each workflow.
- Separate read-only and write-capable credentials where practical.
- Handle expired tokens, invalid tokens, and insufficient scopes as distinct conditions.
Govern marketing data
Consent, subscription status, opt-in and opt-out timestamps, and related legal-basis fields should be treated as governed data. Do not overwrite consent as an incidental effect of a general Contact synchronization.
Operational considerations for HubSpot Marketing Hub integrations
Rate limits and pagination
HubSpot applies usage limits based on account, application, endpoint, and subscription. Martini workflows should detect 429 responses, respect retry timing, use bounded backoff, avoid unbounded parallelism, and prefer supported batch operations. Collection APIs should be paginated until no next page remains.
Idempotency and associations
Define authoritative identifiers and safe create, update, or upsert behavior for each object. Preserve HubSpot IDs, retrieve associations explicitly, and deduplicate webhook deliveries using an event identifier or deterministic key.
Schema and subscription variation
Properties, custom fields, event coverage, API availability, and permissions can differ between HubSpot accounts. Version mappings, validate enumerations and data types, and confirm the connected subscription supports each required capability.
Reliability and observability
- Use scheduled reconciliation because webhook coverage and delivery can be partial.
- Inspect item-level errors from batch and import operations.
- Capture HTTP status, HubSpot error details, object type and ID, correlation data, workflow execution ID, and retry count.
- Test with environment-specific portals, apps, scopes, properties, and webhook subscriptions before production deployment.
Why use Martini instead of scripts or point-to-point integrations?
Centralize integration behavior
Martini provides a governed workflow layer for HubSpot API calls, webhook intake, scheduled synchronization, transformations, target writes, and operational state. This avoids duplicating authentication, pagination, retry, and mapping logic across point-to-point scripts.
Keep mappings and rules maintainable
HubSpot properties and associations can vary by account. Martini workflows make validation, consent handling, source-of-truth decisions, canonical models, and reusable integration logic explicit and maintainable.
Support reliable enterprise operations
Instead of treating an HTTP success response as completion, Martini can inspect item-level results, apply bounded retries, preserve checkpoints, route exceptions, and expose controlled APIs for other applications. The same implementation can combine real-time notifications with scheduled reconciliation.