Blog

LinkedIn Lead Gen Forms API Setup Guide

By
The Reform Team

LinkedIn Lead Gen Forms API simplifies how you manage and sync lead data, eliminating manual CSV downloads. It automates data collection from LinkedIn forms, sending accurate, real-time leads directly to your CRM or marketing tools like Salesforce, Marketo, or HubSpot. This guide covers everything you need to know, from setting up API access to integrating with third-party tools.

Key Highlights:

  • What It Does: Automatically syncs LinkedIn lead form submissions to your CRM or marketing tools.
  • Why It’s Useful: Saves time, ensures data accuracy, and allows instant follow-ups.
  • Who It’s For: Marketers, developers, and business leaders managing LinkedIn campaigns.
  • Requirements: Active LinkedIn Ads account, Super Admin access, and API permissions (r_marketing_leadgen_automation, rw_ads).
  • Setup Steps: Secure API access, map fields, and test integrations with tools like Zapier or through direct API calls.

Benefits:

  • Real-Time Syncing: Leads are routed instantly for quicker follow-ups.
  • Accurate Data: Pulls verified LinkedIn profile details, reducing errors.
  • Custom Tracking: Use hidden fields to track campaign-specific data.
  • Tool Integrations: Works with platforms like Salesforce, HubSpot, and Marketo.

By following this guide, you’ll streamline your lead generation process, saving time and improving efficiency.

How to Test LinkedIn Lead Gen Forms (Verify leads sync to your CRM)

LinkedIn

Prerequisites and API Access Requirements

To make the most of automated lead syncing, it’s crucial to ensure your accounts, permissions, and technical setup are ready to go. Skipping these steps can cause delays, so it’s worth double-checking everything before you start pulling lead data through the LinkedIn Lead Gen Forms API.

Account and Platform Requirements

Everything starts with your LinkedIn account and advertising setup. You’ll need an active LinkedIn Ads account with campaigns already running or prepared to launch. Additionally, Super Admin access to your LinkedIn company page is required.

If you’re managing multiple ad accounts or company pages, make sure your LinkedIn account is linked to all of them. This ensures that all Lead Gen Forms tied to those accounts sync properly with your chosen platform. For users managing several accounts, confirm that your profile has the necessary administrative rights across each one.

You’ll also need a destination for the lead data:

  • Salesforce users: A Sales Cloud org and a user with "Modify All Data" permissions are required.
  • Marketo users: Ensure your LinkedIn account has access to all LinkedIn Business Accounts linked to your sponsored campaigns, along with administrative access to Marketo’s LaunchPoint integration area.

Don’t forget that every Lead Gen Form must include a published Privacy Policy page.

If you’re using automation tools like Zapier, confirm you have an active account with the ability to create Zaps (automated workflows). For those using Reform as part of their lead generation strategy, make sure your Reform account is configured properly. Reform offers additional features like multi-step forms, lead enrichment, and spam prevention to complement LinkedIn’s built-in capabilities.

API Permissions and Scope

The LinkedIn Lead Gen Forms API relies on a permission-based system, and you’ll need to request specific scopes to access lead data programmatically.

The most essential permission is r_marketing_leadgen_automation, which allows you to retrieve lead gen forms and their response data. This is what enables real-time lead syncing. Additionally, you’ll need rw_ads to create and manage Lead Gen Forms via the Advertising API. For LinkedIn-Version 202210 or later, r_organization_admin is required to access organization and admin details.

Depending on your integration needs, you might also need permissions like:

  • r_ads: Provides account structure details for sponsored accounts and campaigns.
  • r_liteprofile: Grants access to authenticated user names and photos.

To request these permissions, submit an access request through LinkedIn’s developer portal. Be specific about your intended use case, listing all required permissions. LinkedIn will review your request based on your business needs. Since approval timelines can vary, it’s a good idea to submit your request several weeks before your planned implementation date.

Once approved, you’ll receive credentials for API authentication. Store these credentials securely, and avoid hardcoding them into your application. Use role-based access to manage API credentials for better security.

After securing the necessary permissions, set up your technical environment to ensure smooth integration with the API.

Technical Environment Setup

Your technical environment must support both LinkedIn Campaign Manager and the admin tools of your destination platform. Use a modern web browser with JavaScript enabled to access LinkedIn Campaign Manager and your CRM’s admin interface. For Salesforce users, ensure you’re working in a supported browser with access to Salesforce Setup and Lightning Experience.

If you’re handling direct API integration or custom development, you’ll need a development environment capable of managing HTTP requests and OAuth 2.0 authentication. Make sure your setup supports secure token storage and management, as you’ll be dealing with sensitive authentication credentials.

Network access is another important factor. Ensure you have access to your organization’s network and any required VPN connections if your systems are behind a corporate firewall. Test the connection between your LinkedIn account and your destination platform by running a test sync through your CRM or marketing automation platform’s integration settings.

Before authentication, document your field mapping between LinkedIn forms and your CRM. Standard LinkedIn fields like name, email, company, and job title should align with corresponding fields in your CRM. If your forms include custom questions (up to three are allowed), create matching custom fields in your destination system to store both the question text and the lead’s answers. For hidden fields used in campaign tracking, remember that Salesforce sorts these fields alphabetically during mapping, so plan your naming conventions accordingly.

Lastly, make sure your data handling practices comply with LinkedIn’s terms of service and relevant data protection regulations like GDPR or CCPA. Document your policies for retaining data collected through the API, and confirm that your CRM or marketing platform has robust security measures in place.

To stay organized, create a pre-implementation checklist:

  • Confirm Super Admin access to your LinkedIn company page.
  • Verify your LinkedIn Ads account is active and in good standing.
  • Check that you have the necessary permissions in your destination platform.
  • Ensure API access requests have been approved.
  • Test browser access to all required admin interfaces.
  • Confirm that custom fields for data mapping have been created.

Address any issues on this checklist before moving on to API authentication. Once everything is in place, you’ll be ready to proceed with integrating the API.

Authentication and Access Token Management

Once you’ve set up API access and your technical environment, the next step is to focus on authentication and managing tokens. These processes ensure secure communication with LinkedIn's API, allowing only authorized applications to access your lead data. Proper token management ensures this access remains secure over time.

How to Request API Access

Start by logging into your LinkedIn Developer account - or create one if needed - and submit a request for Advertising API access. Your request should include details about your intended integration and your organization.

For working with Lead Gen Forms, the primary permissions you’ll need are r_marketing_leadgen_automation to access forms and their responses, and rw_ads to create and manage those forms. Depending on your specific integration, you might also need permissions like r_ads or r_liteprofile.

LinkedIn reviews these requests to ensure they align with its terms of service. The review process can take anywhere from a few days to several weeks, so plan accordingly. To avoid issues later, document the required permissions for each integration.

Once your API access is approved and you’ve secured the necessary credentials, you can move on to generating OAuth tokens.

Generating and Using OAuth Tokens

OAuth tokens are essential for securely authorizing your application to interact with LinkedIn's API. These tokens eliminate the need to expose sensitive credentials. You’ll generate a token using the standard OAuth flow and include it in your API request headers like this:

Authorization: Bearer [your_access_token]

Tokens have a lifecycle: they are generated, used, and eventually expire - typically after one year. For example, in integrations like Marketo’s with LinkedIn Lead Gen Forms, tokens expire one year after authorization, requiring re-authorization before the expiration date. If you’re using tools like Zapier, token management is handled automatically after connecting your LinkedIn Ads account.

Make sure you’re using a LinkedIn account with Lead Gen Form Manager Permissions for the target Business Account. Using a personal account without these permissions can lead to 403 (Forbidden) errors. To avoid disruptions, set reminders to renew tokens well before they expire.

Once you’ve obtained your token, securing it is critical.

Token Security Best Practices

Keeping your OAuth tokens secure is vital for protecting your data. Follow these guidelines to safeguard them:

  • Avoid hardcoding tokens or storing them in version control systems. Use environment variables or secure configuration management tools instead.
  • Encrypt tokens when storing them and always use HTTPS for API communications to protect them during transmission.
  • Limit token scope to only the permissions your application needs.
  • Monitor token usage and set up alerts for unusual API activity.
  • For custom integrations, ensure the token is included in every request, implement retry logic for temporary invalidations, and log API calls for debugging - but never expose tokens in error logs.
  • Store tokens server-side rather than in client-side code to prevent exposure through browser tools.
  • Have a well-documented and tested process for token renewal to ensure smooth re-authorization before tokens expire.

Common issues include 401 (Unauthorized) errors, often caused by expired or invalid tokens, and 403 (Forbidden) errors, which usually indicate insufficient permissions. In either case, check the token’s validity and confirm that all required permissions are properly configured.

Creating and Customizing Lead Gen Forms

With authentication set up and tokens secured, you’re ready to dive into creating forms that capture your leads. LinkedIn Lead Gen Forms make this process seamless by pulling user information directly from their LinkedIn profiles, offering pre-filled, accurate data.

Setting Up Lead Gen Forms in Campaign Manager

Before you start, ensure you have Super Admin access to your LinkedIn company page and Lead Gen Form Manager Permissions for all Business Accounts where you plan to run sponsored campaigns. These permissions are crucial for creating and managing Lead Gen Forms and retrieving lead data through the API.

To get started, open LinkedIn Campaign Manager, go to "Assets", and select "Lead gen forms".

Once inside the Lead Gen Forms section, you’ll create a new form. The process is divided into four parts: Form Details, Lead Details & Questions, Confirmation, and Hidden Fields. Each of these sections plays a role in optimizing your form for effective data collection.

Customizing Form Fields and Questions

The first step is Form Details, where you name your form and configure basic settings. This name is for internal use only and won’t be visible to prospects.

Next, in the Lead Details & Questions section, you’ll configure the data to collect. LinkedIn automatically pre-fills information from verified profiles, reducing manual input and ensuring accuracy. This feature minimizes friction and improves the quality of the data collected.

You can include up to three custom questions and five custom checkboxes to gather additional information beyond what LinkedIn profiles provide. Use these custom questions to qualify leads effectively - focus on concise, relevant questions that align with your offer. Avoid asking for details already available in LinkedIn profiles, as this can discourage users from completing the form.

Checkboxes are ideal for obtaining consent-based information, such as privacy policy acknowledgment or communication preferences. To comply with data protection regulations, include a link to your company’s Privacy Policy page within the form. Make sure this page is live on your website before you proceed.

The order of your questions matters. Place the most important qualifying questions at the top to ensure you capture critical information, even if a user doesn’t complete the entire form.

The third section, Confirmation, determines what users see after submitting the form. Use this space to craft a brief thank-you message, provide a landing page URL, and choose a relevant call-to-action from the dropdown menu. This follow-up message is a key opportunity to keep prospects engaged with your brand.

If you plan to integrate with CRM or marketing automation tools, remember that only LinkedIn fields saved to a form template in Campaign Manager will be available for mapping to third-party systems. Plan your field configuration accordingly.

Adding Hidden Fields for Tracking

The final section, Hidden Fields, is optional but highly useful for tracking and integration. These fields allow you to collect metadata without displaying it to users, offering valuable insights into lead origin and intent.

Hidden fields can include details like an agency ID to identify the source of the lead, a product ID to track interest in specific offerings, or a campaign source identifier to link leads to specific LinkedIn campaigns. This data enhances lead routing, attribution tracking, and campaign performance analysis.

When you download lead data as a CSV file, hidden field values will appear alongside visible form responses, enabling detailed segmentation and analysis.

Before launching your form, test it thoroughly. Navigate to the form management section, click "Preview" from the dropdown menu, and simulate the user experience by interacting with the form, checking the privacy policy box, and submitting it.

After testing, download the CSV file containing your test data. In the file, TRUE values indicate test leads, while FALSE values represent actual leads, helping you distinguish between the two.

Integrating Lead Data with Third-Party Tools

Once your forms are live, the next step is to channel the lead data into the tools you use every day. Building on account setup and authentication, this section explains how to integrate LinkedIn Lead Gen Forms with various platforms, including CRMs, marketing automation tools, and custom systems.

Before diving in, make sure your LinkedIn account has Lead Gen Form Manager Permissions for all relevant Business Accounts. Without these permissions, you might not see all the accounts you need during setup, which can lead to integration issues.

CRM Integration (Using Salesforce as an Example)

Salesforce

Connecting LinkedIn Lead Gen Forms to your CRM eliminates the need for manual data entry, ensuring leads flow directly into your sales pipeline. For Salesforce, you can either use middleware platforms or create a custom API connection. This process involves authenticating both your LinkedIn Ads account and your Salesforce instance, followed by mapping fields between the two systems.

For example, you can map LinkedIn's "Email Address" field to Salesforce's "Email" field, or LinkedIn's "Company Name" to Salesforce's "Account Name." Keep in mind that only fields saved in your LinkedIn form templates will be available for mapping. If you're using tools like Marketo, you can even map two LinkedIn fields to a single CRM field (as long as they're from different forms) to ensure accurate lead recording.

If you're a HubSpot user, LinkedIn Ads can be connected directly through HubSpot's native integration. Simply go to Settings > Marketing > Ads to sync lead data automatically. For workflows requiring no-code automation, consider using Zapier.

Automating with Zapier

Zapier

Zapier provides a no-code way to link LinkedIn Lead Gen Forms to a wide range of applications. To set up an integration, select LinkedIn Ads as the trigger app and choose "New Lead Gen Form Response" as the event. Then, connect an action app, such as Google Sheets for tracking leads, an email platform for follow-ups, or your CRM for adding new contacts.

You'll need an active LinkedIn Ads account to use Zapier with Lead Gen Forms. Common workflows include adding leads to Google Sheets, sending personalized emails, or creating CRM entries. For platforms not directly supported by Zapier, webhooks can be used to send data to custom endpoints. Always test your Zaps using Zapier's built-in tools before rolling them out fully.

Custom Workflows with Direct API Integration

For those looking for greater flexibility, direct API integration offers complete control. This method involves making authenticated API calls to programmatically retrieve lead data. Start by authenticating your application with OAuth 2.0 credentials, then use GET requests to fetch JSON data, which includes contact details, custom form responses, and timestamps.

You can filter data by ad accounts, lead forms, or campaigns to extract just the information you need. Make sure to include valid OAuth tokens in your request headers, and note that these tokens expire one year after setup, so plan for re-authorization with automated reminders.

For testing, you can download lead data as CSV files through Campaign Manager. These files use TRUE or FALSE values to differentiate test leads from real ones. In production, ensure you have robust error-handling mechanisms, comply with rate limits, and validate data properly. Store OAuth tokens securely using encryption and access controls, and avoid hardcoding credentials in your code.

Hidden fields can also play a significant role in tracking. These fields capture extra data - like agency IDs, product IDs, or campaign sources - without being visible to users. When retrieving lead data, these hidden values appear alongside visible responses, enabling advanced lead routing and performance analysis.

If API integrations feel too complex, Reform offers a simpler, no-code alternative. Reform integrates smoothly with CRMs and marketing tools, allowing custom field mapping, duplicate management, and advanced features like conditional routing and spam prevention - all without writing any code.

Testing and Deployment

Once your API is set up and your forms are customized, the next step is to test everything thoroughly. This ensures your integration works smoothly and helps you catch any issues early, avoiding potential data problems down the line.

Testing API Connections and Lead Flow

Start by confirming your API permissions. You’ll need r_marketing_leadgen_automation to read data and rw_ads to manage forms. A quick API call to fetch your existing lead gen forms is a simple way to verify that your OAuth token is functioning correctly.

To test lead flow, create test leads using Campaign Manager. Go to the account, campaign group, and form where your lead gen form is stored. Use the "Preview" mode by clicking "manage", selecting the three-dot menu, and choosing "Preview." In this mode, click the call-to-action button, check the privacy policy box, and submit the form to generate a test lead.

After submitting a test lead, download the resulting CSV file. Check that all fields - especially custom and hidden ones - are correctly formatted and populated. Ensure LinkedIn is pulling contact information directly from user profiles as expected.

If you’re using tools like Zapier, test your integration by creating a new lead gen form response to confirm the trigger works properly. For CRM integrations, submit test leads and track their progress through your pipeline. Double-check that LinkedIn fields map accurately to your CRM fields and that data transfers cleanly. Be sure to test edge cases, including forms with custom questions, hidden fields, and conditional logic, to confirm all data types are handled without errors.

If any problems surface during testing, refer to the troubleshooting steps outlined below.

Troubleshooting Common Issues

Authentication errors or access problems? First, verify that your account has Lead Gen Form Manager Permissions and that your OAuth tokens are still valid. Tokens expire one year after being issued, so it’s smart to set a reminder to renew them around the 11-month mark to avoid interruptions.

If leads aren’t syncing to your CRM, check that the integration is authorized and that the correct ad accounts and lead forms are selected. Review your field mappings - refer to guidelines like those for Marketo to ensure compliance. Check API and CRM logs to see if leads are being captured but not syncing. For Zapier users, test both the trigger and action steps to ensure everything runs as expected. Also, investigate for data validation errors in your CRM, as missing required fields or incorrect formats could block leads from syncing.

Effective error handling is crucial. Log all API responses with details like timestamps, endpoints, parameters, status codes, and response bodies. Set up specific error handlers for common issues such as authentication errors (401/403), rate limiting (429), malformed requests (400), and server errors (500+).

Once issues are resolved, keep monitoring your integration to ensure a seamless lead flow.

Performance Monitoring After Deployment

When your integration is live, tracking key metrics will help ensure everything runs smoothly. Monitor API response times and submission success rates to catch potential problems early.

Check how quickly data syncs between LinkedIn and your CRM - leads should generally appear within 5–15 minutes of submission. If syncing takes longer, investigate rate limiting or authentication issues.

Evaluate how accurately LinkedIn auto-fills contact information by comparing the percentage of leads with complete details to those with missing data. Keep an eye on API rate limits and quota usage to avoid throttling, and set up alerts for authentication failures or token expirations that could disrupt your lead flow. Additionally, track form abandonment rates to identify whether design or load-time issues might be causing users to drop off. Use your CRM’s reporting tools to analyze metrics like conversion rates and lead-to-customer ratios to ensure the leads you’re generating align with your business goals.

For effective troubleshooting and analysis, maintain centralized logging with at least 30 days of data retention. Include details like which lead gen form generated a submission, the associated campaign, and user information to streamline post-incident reviews.

Tools like Reform can simplify this process with real-time analytics, A/B testing, and automatic spam prevention, all integrated with your CRM.

Conclusion and Next Steps

Key Takeaways

To get started with the API, make sure to obtain the necessary permissions (r_marketing_leadgen_automation and rw_ads) and secure OAuth tokens - don’t forget to renew them before they expire. When mapping fields for LinkedIn Lead Gen Forms, ensure each form has unique mappings. Keep in mind that only fields saved to form templates in Campaign Manager can be used for mapping.

There are three main ways to integrate: using LinkedIn’s native CRM connections, automating workflows with Zapier (requires an active LinkedIn Ads account), or implementing the API directly for greater flexibility.

Before launching, test your forms in Campaign Manager to confirm field mapping and syncing are working as expected. Once deployed, monitor lead volume, data accuracy, and sync performance regularly.

These steps provide a foundation to take your lead generation to the next level, especially when paired with tools like Reform.

How Reform Can Improve Your Lead Generation

Reform

LinkedIn Lead Gen Forms are great for gathering initial contact details, but Reform takes things further by offering advanced features like lead qualification, real-time email validation, spam prevention, and enriched data fields. It also supports seamless integration with CRMs and marketing automation platforms. Additional tools, such as conditional logic, A/B testing, and a "Finish Later" option, help maximize conversions. Companies in the B2B and SaaS space have reported a 215% increase in qualified leads using Reform’s features.

The platform’s no-code customization and real-time analytics mean you can continually refine your forms without needing a developer, making it easier to optimize your campaigns.

Next Steps for Implementation

Here’s how to move forward with your integration:

  1. Request API access and document your unique field mappings. Identify which LinkedIn Business Accounts require integration access.
  2. Set up your authentication environment and ensure secure token storage. Once ready, connect to production systems.
  3. Use LinkedIn’s Campaign Manager to create test forms and generate sample leads to validate your setup.
  4. Schedule regular reminders to renew your OAuth tokens before they expire. Document your configurations, mappings, and troubleshooting steps for easier maintenance.

To go beyond LinkedIn’s basic lead capture, consider trying Reform’s free plan. Its advanced features integrate seamlessly with your tools, giving you more control over lead qualification. Also, keep an eye on LinkedIn’s developer documentation for updates, and monitor your API usage to avoid hitting quota limits during busy periods.

FAQs

What permissions are required to connect LinkedIn Lead Gen Forms to my CRM, and how can I set them up?

To connect LinkedIn Lead Gen Forms with your CRM, you’ll need to ensure the proper API permissions are in place. Specifically, you’ll need Lead Management permissions, which allow you to access and handle lead data collected through LinkedIn forms.

Here’s how to set it up: Log in to your LinkedIn Developer account, head to your app settings, and make sure the Lead Gen Forms product is activated. Next, you’ll need to generate an access token by following LinkedIn’s OAuth 2.0 authentication process. Once you have the token, you can use it to link your CRM with LinkedIn’s API, enabling a smooth transfer of lead data.

How can I keep the data collected through LinkedIn Lead Gen Forms secure and compliant with data protection regulations?

To keep data gathered through LinkedIn Lead Gen Forms safe and compliant, consider these key practices:

  • Secure LinkedIn's API usage: Use reliable authentication methods, like OAuth 2.0, to manage access and safeguard sensitive data effectively.
  • Follow data protection regulations: Understand and comply with laws such as GDPR, CCPA, or any other relevant regulations to ensure proper data management.
  • Restrict data access: Limit access to the collected information to only authorized team members and store it using secure systems.

Make it a habit to regularly evaluate your data handling and integration processes to ensure compliance and protect user privacy.

How do hidden fields in LinkedIn Lead Gen Forms enhance lead tracking and analysis?

Hidden fields in LinkedIn Lead Gen Forms let you include extra, invisible data with every lead submission. This could be anything from campaign IDs and tracking sources to custom parameters that help you keep your leads organized and trackable.

These fields make it easier to segment leads, improve tracking accuracy, and feed more detailed data into your CRM or marketing tools. The result? Clearer reporting and the ability to fine-tune your campaigns for improved performance.

Related Blog Posts

Discover proven form optimizations that drive real results for B2B, Lead/Demand Generation, and SaaS companies.

Lead Conversion Playbook

Get new content delivered straight to your inbox

By clicking Sign Up you're confirming that you agree with our Terms and Conditions.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
The Playbook

Drive real results with form optimizations

Tested across hundreds of experiments, our strategies deliver a 215% lift in qualified leads for B2B and SaaS companies.