Login to LinkedIn (v2)
POST /api/v1/login_v2
Log in to a LinkedIn account via We-Link. Returns an accountId for all subsequent API calls and delivers the login result asynchronously via webhook.
Optionally pass a twoFASecret to enable automatic 2FA — We-Link will generate TOTP codes in the background so logins are completely hands-free.
We-Link persists the session once an account is successfully connected — you do not need to log in again unless the session expires or is explicitly disconnected. Logging in multiple times creates duplicate sessions, which can trigger LinkedIn's security systems to flag your account and may result in temporary or permanent restrictions. Always check the account status before attempting a new login.
We-Link caches login sessions internally. If a valid cached session exists for the account, the login call will reuse it instead of creating a new session with LinkedIn. This reduces unnecessary login attempts and helps avoid triggering LinkedIn's security systems.
Before you begin
- Social login is not supported — the LinkedIn account must have a password set. Accounts created via Google, Apple, or other third-party providers must first set a LinkedIn password.
- 2FA is handled via webhooks — the API response won't tell you if 2FA is enabled. Enable the Login PIN Required webhook event so We-Link can notify you when LinkedIn asks for a code. Then prompt the user and submit it via Submit OTP. See the 2FA guide for details.
Proxy Configuration
A proxy is required for every login request. Choose one of the two options below.
Option 1 — Internal Proxy (Recommended)
We-Link assigns a high-quality, geo-located IP. Pass a location country code (e.g. "US"):
{
"email": "example@mail.com",
"password": "password",
"proxy": {
"location": "US"
},
"twoFASecret": "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456"
}
If you log in from one location and later log in again from a different location, it will incur additional charges because proxies are allocated per location. Make sure to provide the correct location to avoid unnecessary credit usage.
During the trial period, only one LinkedIn account and one internal proxy are provided. This means only one proxy location is allowed if you choose the Internal Proxy option.
Option 2 — Customer Proxy
Provide your own proxy credentials:
{
"email": "example@mail.com",
"password": "password",
"proxy": {
"host": "hostip",
"port": 4000,
"username": "username",
"password": "password"
},
"twoFASecret": "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456"
}
If no internal proxy is available for the requested location, the API returns a 400 Bad Request:
{
"message": "No proxy available for location:IN",
"error": "Bad Request",
"statusCode": 400
}
For a full explanation of proxy options, billing, and best practices, see Proxy Configuration.
Headers
| Name | Type | Required |
|---|---|---|
x-api-key | string | Yes |
x-api-secret | string | Yes |
Request Body
Schema
Sample Request
{
"email": "string",
"password": "string",
"proxy": {
"location": "string",
"host": "string",
"port": 0,
"username": "string",
"password": "string"
},
"twoFASecret": "string"
}
Responses
Immediate Response
The API immediately returns an accountId and requestID. This does not mean the user is logged in yet — the login result is delivered asynchronously via webhook.
{
"accountId": "1234ab5678290....",
"requestID": "abc1234efh012...."
}
Webhook Events
Delivered when the login completes successfully.
Schema
Sample Response
{
"status": "SUCCESS",
"requestId": "string",
"result": {
"first_name": "string",
"last_name": "string",
"profile_id": "string",
"public_identifier": "string",
"premium": false,
"occupation": "string",
"email": "string"
}
}