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 EndpointPOST Create or Update User.
Example Request Body:
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 EndpointPOST - 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:
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.
- 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.
Refreshing Cookies
Cookies need refreshing if:- You log out of LinkedIn
- LinkedIn expires or changes cookies
- LinkedIn restricts the account due to excessive activity
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 passingli_a and/or li_at cookie values.
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
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_uidfor faster resolution.