API · LinkedIn
POST /linkedin/accounts
Connect your own LinkedIn session
| Request | POST /v1/linkedin/accounts |
| Operation id | linkedin.accounts.connect |
| Cost | Free |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Checks the session with LinkedIn and stores it only if it works. A session that needs a security check, is restricted or logged out is refused with a 422-style invalid_request and nothing is stored.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
li_at | string | yes | The value of the li_at cookie of a session you logged into yourself. |
jsessionid | string | yes | The JSESSIONID cookie of the same session (ajax:…). |
user_agent | string | yes | The user agent of the browser that session lives in. |
li_a | string | no | Optional: the li_a cookie LinkedIn sets once you open Sales Navigator in that browser. Needed for the Sales Navigator endpoints. |
proxy | string | no | Optional: your own proxy (ideally a static IP in your country) for every request on this account. Without one we pin the account to one sticky residential exit. |
country | string | no | Optional: ISO country of the account, for the exit we pin. |
label | string | no | Your name for this session, up to 60 characters. |
Responses
| Status | Meaning | Schema |
|---|---|---|
201 | Connected. | ConnectedSession |
400 | Invalid input. | Error |
401 | Missing or invalid credentials. | Error |
404 | No connected LinkedIn session with that id among yours. | Error |
409 | Already 10 connected LinkedIn sessions on this account. | Error |
422 | LinkedIn did not accept the session. Nothing was stored. | Error |
429 | Too many connect attempts. Wait for Retry-After seconds. | Error |
503 | LinkedIn could not be reached. Retryable; nothing was stored. | Error |
ConnectedSession fields
| Field | Type | Description |
|---|---|---|
id | string | |
platform | string | |
label | string | null | |
status | "ok" | "checkpoint" | "restricted" | "logged_out" | ok: usable. checkpoint, restricted, logged_out: the network needs you, in your own browser; calls on it stop until you reconnect. |
status_detail | string | null | |
profile | object | Non-secret facts about the account (name, public id). |
created_at | string | |
last_checked_at | string | null | |
last_used_at | string | null | |
quotas | object[] |
Errors use one shape everywhere; see Errors for every code and what to do.