A comprehensive, enterprise-grade guide to instantly syncing Flex Forms submissions to HubSpot as Contacts, Companies, and Deals.
The HubSpot integration is an enterprise-grade pipeline designed to seamlessly route form submissions into your marketing ecosystem. Instead of relying on fragile Zapier connections, this integration allows Flex Forms to automatically generate structured Contact records, update their properties, and trigger advanced Marketing Hub workflows the exact second a user clicks submit.
When a prospect fills out a “Contact Sales” form on your website, Flex Forms instantly creates a new Contact in HubSpot. You can simultaneously map hidden UTM parameters so your marketing team knows exactly which ad campaign generated the lead, triggering your sales outreach SLA.
Marketing Workflow Triggers
By mapping specific dropdown selections (e.g., “Company Size”) directly to HubSpot Contact Properties, you can trigger highly complex, conditional email drip campaigns in HubSpot the moment the data arrives.
To establish a secure, authenticated connection between Flex Forms and your HubSpot environment, you must generate a Private App Access Token. Follow these exact, step-by-step instructions carefully to ensure a successful integration. (HubSpot deprecated legacy API keys in 2022).
1
Step 1: Log into your HubSpot Dashboard
Open your web browser and navigate to your HubSpot portal (e.g., https://app.hubspot.com). Enter your credentials to log in.Note: You must have Super Admin privileges in HubSpot to create Private Apps.
2
Step 2: Locate the Settings Gear
Once you are logged into the main dashboard, look at the absolute top right corner of your screen, right next to your profile picture. You will see a gear icon (Settings). Click it.
3
Step 3: Navigate to Private Apps
On the Settings page, look at the left-hand sidebar menu. Scroll down until you find the Integrations section. Expand it, and click exactly on the link labeled Private Apps.
4
Step 4: Initiate App Creation
You are now on the Private Apps management page. In the top right area, click the prominent orange button labeled Create a private app. This will open a configuration screen.
5
Step 5: Configure Basic Info
In the “Basic Info” tab, you must provide a Name. Type exactly: Flex Forms Production Integration. You can also upload the Flex Forms logo here so your team knows what this app is for.
6
Step 6: Grant Scopes (Crucial Step)
Click on the Scopes tab at the top. You MUST search for and check the boxes for the following permissions:
crm.objects.contacts.write
crm.objects.contacts.read
CRITICAL WARNING: Without these exact scopes, Flex Forms will not have permission to create or read contacts, and the API will return a 401 Unauthorized error.
7
Step 7: Generate and Secure the Token
Click the Create app button in the top right. A warning modal will appear; click Continue creating. Finally, click Show token.Highlight the entire long string of text, right-click, and select Copy (or press Ctrl+C / Cmd+C). Keep this safe, as HubSpot will only show it to you once.
8
Step 8: Create a Connection (recommended)
Leave HubSpot open and switch to Flex Forms → Integrations → Connections.
Create a HubSpot connection and label it (for example Production portal).
Paste the Private App token into the connection credentials.
Connect so the status shows Connected.
9
Step 9: Optional Catalog fallback
For a single shared portal only, open Integrations → Catalog → HubSpot, paste the token, and save. Prefer Connections when you may add another portal later.
HubSpot can call Flex Forms when a contact changes. Configure the inbound webhook secret on the same Connection or Catalog credentials, then point HubSpot at:POST /flex-forms/integrations/hubspot/webhookMatching contacts update name fields and last-seen timestamps in Flex Forms Contacts (not a full CRM mirror).
Establishing the connection is only half the battle. Now, you must instruct Flex Forms on exactly how to translate your form fields into HubSpot’s specific database architecture.By default, Flex Forms will automatically map your primary Email Block to HubSpot’s core email property. Everything else must be explicitly mapped using HubSpot’s Internal Names.
Standard Field Mapping
Exact Mapping Example
You define these mappings on the form hub Integrations tab.The format is always: hubspot_internal_name=flex_forms_block_nameHere are the most common standard HubSpot keys you will use:
firstname (The person’s first name)
lastname (The person’s last name)
phone (Their mobile number)
company (The company they work for)
website (Their company URL)
If you have a Short Text block named first_name_input and a Phone block named user_phone, your mapping configuration would look exactly like this:
The Label Trap: Never use the human-readable Label from HubSpot. If your HubSpot property is labeled “Job Title”, its internal name is actually jobtitle. If you try to map Job Title=job_title, the API will instantly reject the payload.
Even with a perfect setup, enterprise environments can experience edge cases. Here is how to diagnose and resolve them.
API Error: 401 Unauthorized
The Problem: The form submission failed, and the server logs show a 401 Unauthorized error returned by HubSpot.The Solution: You likely copied a legacy HubSpot API Key instead of generating a modern Private App Token. HubSpot completely disabled legacy API keys in November 2022. You must go back to Step 3 and create a Private App to get a valid token.
API Error: Property does not exist
The Problem: You get a 400 Bad Request error stating that a property does not exist.The Solution: You have a typo in your Field Mapping, or you used the human-readable Label instead of the Internal Name. Check your spelling against HubSpot’s internal property names (e.g., use firstname, not first_name).
Duplicate Contact Management
The Problem: You are worried that if the same person fills out the form twice, it will create two messy duplicate records in HubSpot.The Solution: You don’t need to worry. Flex Forms relies on HubSpot’s core deduplication logic. HubSpot uses the email address as the primary unique identifier. When a submission is processed, if HubSpot finds an existing Contact with that exact email address, it safely updates their existing properties with the new data instead of creating a duplicate.
The following advanced settings are available in the Flex Forms UI for this integration. Use this reference to understand exactly how each field impacts the API payload.
Private App access token
The OAuth token used to authenticate with HubSpot. You must generate this from HubSpot → Settings → Integrations → Private Apps.
Required Scopes: Ensure your token is granted crm.objects.contacts.write and crm.objects.contacts.read permissions.
Portal ID (Hub ID)
Optional. Flex Forms automatically detects your Hub ID via the API account-info endpoint. You only need to provide this manually if you have multiple nested Portals and the API detects the wrong one.
HubSpot form
Select an existing form directly from your HubSpot account to pipe data into. If left blank, Flex Forms can automatically generate a matching form in HubSpot for you.
Auto-create HubSpot form
If enabled and form_guid is empty, Flex Forms will use the HubSpot API to dynamically generate a new form inside your HubSpot account the very first time a user submits this Flex Form.Options:
1: Yes — create when GUID is empty
0: No — require selecting an existing form manually
Lifecycle stage field
Map a specific form block (e.g. a dropdown) directly to HubSpot’s internal lifecyclestage property (e.g., subscriber, lead, marketingqualifiedlead, customer).
Additional contact properties
The core mapping engine for custom properties. You must use exact internal HubSpot property names.
Format: One per line as hubspot_internal_name=flex_forms_block_name.
Available properties (reference)
Loaded live from your HubSpot account. Use this dropdown to find the correct internal property names to use in the field_map above.
Contact owner mode
Allows you to automatically assign a HubSpot user (Owner) to the newly created contact, bypassing the need for complex HubSpot workflows.Options:
none: Do not assign an owner.
select: Assign a fixed owner to all submissions from this form.
conditional: Use logic rules to assign different owners based on how the user answered the form.
Conditional owner rules
The routing engine for conditional owner assignment. Provide one rule per line using the exact format: owner_id|field|operator|value.Example:55|country_dropdown|=|United States (If they select US, assign to Owner ID 55).Supported operators: =, !=, contains, >, <
HUTK field
Map to a form field that stores the HubSpot tracking cookie (hubspotutk) if you capture it manually (often a text field with Hide enabled so respondents never see it).
Exclude hutk cookie
By default, Flex Forms extracts the hubspotutk cookie from the user’s browser and attaches it to the API payload, allowing HubSpot to tie the submission to their browsing history. Use this setting to disable tracking for strict GDPR compliance.