Skip to main content
This guide explains how to handle LinkedIn cookies, manage user accounts, and understand the different LinkedIn licenses supported on Captain Data.

Handling LinkedIn Accounts

Adding a New User

To automate LinkedIn actions, you must first add a user on Captain Data using the API Endpoint POST Create or Update User. Example Request Body:
The country field provisions a proxy IP matching that country. This country must match the location where you log into your LinkedIn account to avoid restrictions.
You can use any ISO 3166-1 alpha-2 country code except the following:
These country codes are restricted to ensure compliance with platform requirements and maintain secure automation.
If using a VPN, ensure the VPN’s country matches the one in Captain Data, or disconnect the VPN when logging in.

Linking LinkedIn Accounts to Users

After adding a user, you will connect an integration account in order to link the LinkedIn account to the user using the API Endpoint POST - Add or Update an Integration Account. The core of the LinkedIn integration are the cookies, which allow us to perform the desired actions on LinkedIn. Here’s an example account payload, using the previously created user_uid:
For LinkedIn Sales Navigator, include both the li_a and li_at cookies for a more stable and faster connection.
If you wan to create a Shared LinkedIn Account, add the following to your request:
Reminder: A Shared Account allows external users to connect their accounts via a Captain Data shared link, which grants them access to sync their credentials.

Best Practices for LinkedIn Automation

VPN and Country Settings
  • Ensure the country in Captain Data matches your login location on LinkedIn.
  • Match your VPN’s country with Captain Data, or disconnect the VPN while logging in.
Managing Chrome Sessions
  • Use Captain Data’s Chrome Extension to automatically sync cookies.
  • For multiple LinkedIn accounts, you must create separate Chrome sessions:
    • Click your Chrome profile icon > Add a new profile.
    • Name it according to the LinkedIn account (e.g., “Account B”).
    • Log in to Captain Data and LinkedIn within this new session.
Updating cookies for Account A while logged into Account B can lead to mismatches and errors.

Refreshing Cookies

Cookies need refreshing if:
  • You log out of LinkedIn
  • LinkedIn expires or changes cookies
  • LinkedIn restricts the account due to excessive activity
Regular activity and following Smart Limits guidelines help prevent restrictions.

How to refresh cookies via API

In order to refresh accounts via API you need to use the POST - Add or Update an Integration Account by passing li_a and/or li_at cookie values.
If you build your own Chrome Extension, you should refresh cookies every 2 hours or so.
Here’s a code example for a Chrome Extension that runs in the background using alarms:
Complete source code is available on GitHub.

Smart Limits to Prevent Account Restrictions

Captain Data developed a unique Smart Limits feature to protect your users’ LinkedIn accounts. Learn more in this article LinkedIn Rate Limits.

LinkedIn Licenses Compatibility

Captain Data supports various LinkedIn licenses, each with unique features and limitations. Below is a breakdown of how each license integrates with Captain Data: Today Captain Data handles LinkedIn Basic, LinkedIn Premium Business, and Sales Navigator Core which are defined as levels in the LinkedIn integration.

Troubleshooting LinkedIn Login Errors

When connecting a LinkedIn account (via cookies or native login), you may encounter various errors. Below is a guide to the most common error cases, their meanings, and how to resolve them.

Common Error Cases

Notes & Recommendations

  • Google Login: If your LinkedIn account uses Google login, you must set a password on LinkedIn (via “Forgot password”) to use native login.
  • IP/Location Issues: Many errors are related to IP allocation or location mismatches. Make sure your timezone and country settings in Captain Data match your actual login location.
  • Challenge/2FA: If you receive a challenge (SMS, email, in-app), complete it promptly. If it expires, restart the login process.
  • Contact Support: For persistent or unclear errors, contact support and provide your identity_uid for faster resolution.
For more details, see the LinkedIn authentication and checkpoint API documentation. By following this guide, you can safely automate LinkedIn activities with Captain Data, ensuring stable sessions and avoiding platform restrictions. For further assistance, feel free to reach out to our support team at support@captaindata.com 🙌