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:

{
  "email": "[email protected]",
  "full_name": "John Doe",
  "country": "FR"
}

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:

"MG","RE","CI", "NA", "CV", "MU", "HN", "UY", "XK", "GN", "UA", "BB", "PF", "QA", "KY", "LY", "LB", "VE", "UG", "CH", "PK"

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:

{
  "account": {
    "name": "Name of the account",
    "cookies": {
      "li_at": "YOUR_SESSION_COOKIE",
      "li_a": "If the account is a Sales Navigator one"
    },
    "user_uid": "xxxxx-xxxxx-xxxxx-xxxxx"
  }
}

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:

{
  "shared_account": true
}

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:

/**
 * Alarm to update cookies every X minutes.
 */
chrome.alarms.onAlarm.addListener(() => {
  // Ensure updateTokensHandle() is defined elsewhere in your code
  return updateTokensHandle();
});

// Set up the alarm when the extension is installed
chrome.runtime.onInstalled.addListener(async ({ reason }) => {
  const periodDurationMinutes = 120; // Every 2 hours

  // Create an alarm that will trigger every `periodDurationMinutes`
  await chrome.alarms.create("updateToken", {
    periodInMinutes: periodDurationMinutes,
  });

  console.log(
    "Alarm created to update token every " + periodDurationMinutes + " minutes"
  );
});

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:

LicenseCaptain Data LevelCaptain Data CompatibilityInMails/MonthInvitations with NoteCRM Integration
LinkedIn BasicClassicYes05/monthNo
LinkedIn Premium CareerClassicNo5N/ANo
LinkedIn Premium BusinessClassicYes15400No
Sales Navigator CoreSales NavigatorYes50400No
LinkedIn Sales SolutionsN/AN/AN/AN/AN/A

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

ScenarioMessageStatusError
Invalid credentialsUsername or password invalid.400INVALID_CREDENTIALS
Check your LinkedIn username and password.
See authentication endpoint
Google login not supportedUsername or password invalid.400INVALID_CREDENTIALS
Google login is not supported.
Use “Forgot password” on LinkedIn to set a password and use that for login.
Checkpoint code invalidCode invalid.400INVALID_CODE
The checkpoint (2FA/SMS/email) code is incorrect. Try again.
See checkpoint endpoint
Failed IP attributionCould not login the account.500LOGIN_ACCOUNT_500_ERROR
Retry logging in. This is a LinkedIn-side issue.
IP allocation errorIP allocation error. Please retry again in 5 minutes or contact support.400IP_ATTRIBUTION_ERROR_400
Wait 5 minutes and try again, or contact support.
IP allocation conflictIP allocation error. Please retry again in 5 minutes or contact support.409IP_ATTRIBUTION_CONFLICT_409
Wait 5 minutes and try again, or contact support.
IP rate limit exceededRate limit exceeded IP attribution, please try again in five (5) minutes or contact the support.429IP_ATTRIBUTION_RATE_LIMIT_429
Wait 5 minutes and try again, or contact support.
No IP available in timezoneNo IP available in this timezone. Update your timezone to a neighbouring one or contact support.400IP_TIMEZONE_NOT_SUPPORTED_400
Change your timezone in Captain Data or contact support.
Captcha challengeError while resolving the challenge, the Captcha challenge seem to be pending. Re-send username and password to overcome this.500CAPTCHA_CHALLENGE_ERROR
Retry the authentication with your credentials.
Unsupported challengeUnsupported challenge identified, please contact the support and provide it with the user_uid so we can address it.500UNSUPPORTED_CHALLENGE
Contact support with your user_uid.
Simple challenge failedError while solving challenge, retry in 5 minutes, if it persists contact support.500LOGIN_SIMPLE_CHALLENGE
Wait and retry, or contact support.
In-app challenge pendingWaiting for user to validate in_app_challenge500IN_APP_CHALLENGE_PENDING
Complete the challenge in your LinkedIn app.
In-app challenge expiredIn_app_challenge expired. Please retry the whole process by sending credentials again on /authenticate500IN_APP_CHALLENGE_EXPIRED
Start the login process again.
2FA expired2FA expired. Please retry the whole process by sending credentials again on /authenticate5002FA_VALIDATION_EXPIRED
Start the login process again.
Checkpoint missing dataError while solving the challenge, retry the whole process by sending credentials to /authenticate again500CHECKPOINT_MISSING_DATA
Start the login process again.
User management not permittedUser management via the API is not permitted for the current workspace, activate the option on settings403CREATE-ONE-ACCOUNT-403-FORBIDDEN
Enable user management in your workspace settings.
Account with same LinkedIn ID already existsAn account with the same Linkedin ID already exists.409CREATE_OR_UPDATE_ACCOUNT_409_CONFLICT
Use a different LinkedIn account or user.
Account already exists on userAn account already exist on this user409CREATE_OR_UPDATE_ACCOUNT_409_CONFLICT
This will be merged in the future.
Account link changePlease note that your account is different from the one that has already been synchronized.409CREATE_OR_UPDATE_ACCOUNT_409_CONFLICT
Use the same LinkedIn account as previously connected.
Other errorsError while synchronizing your account, please retry again or contact the support.500-
Retry or contact support.

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 [email protected] 🙌