Connect a LinkedIn account, answer its checkpoints, keep it signed in.
Each LinkedIn account runs on its own browser identity and its own sticky IP, in the country you choose. Swarmhit keeps it signed in and tells you when it needs you.
Connecting an account
POST /api/v1/accounts
takes one of two kinds of connection:
- Credentials:
usernameandpassword, and optionallytotp_secretso Swarmhit answers an authenticator 2FA by itself. - Cookie:
access_token, the member'sli_atcookie (optionallyjsessionid,user_agent,browser,cookies). A cookie connect answers201or an error, never a checkpoint.
curl -X POST https://console.swarmhit.com/api/v1/accounts \
-H "X-API-KEY: gw_live_…" -H "Content-Type: application/json" \
-d '{"provider":"LINKEDIN","username":"jane.doe@example.com","password":"…","country":"FR"}'A credentials connect signs in the way the member would, which can take up to about 150 seconds (give the call a long timeout), and answers one of:
201 AccountCreated: signed in. Storeaccount_id.202 Checkpoint: LinkedIn asks for something;checkpoint.typesays what.202 AccountQueued: the result arrives as events (AccountStatusOK,gateway.checkpointorgateway.sign_in_failed). This happens only when Swarmhit queues the sign-in, or for a connect that sent"background": true(where Swarmhit enables it) and needs no typed code.
A refused connect (wrong password, throttled, no IP) keeps nothing: retrying it reuses the same device and IP.
Checkpoints
checkpoint.type | What to do |
|---|---|
OTP, 2FA, PHONE_REGISTER | Send the code (or phone number) with POST /api/v1/accounts/checkpoint { "account_id", "code" }. The answer is again 201, 202 (LinkedIn chains steps) or an error. …/checkpoint/resend asks for a new code. |
IN_APP_VALIDATION | The member approves the sign-in in their LinkedIn app. Poll GET /api/v1/accounts/{id}, or wait for the OK account status event. |
CAPTCHA, UNKNOWN | A person has to look: use the live view below. |
The live view
When a person has to look, the answer carries a live view: { token, expires_at }.
Open the websocket wss://console.swarmhit.com/li-live/<token>. It streams the sign-in's
browser as JPEG frames ({ type: 'frame', data, meta }, then
{ type: 'state', state: 'live' | 'finishing' | 'ended' }) and takes the person's input
({ type: 'mouse', action, x, y }, wheel, key, text). The token is single use and
lasts 10 minutes; POST /api/v1/accounts/{id}/live-view
mints a new one. When the person is through, the account becomes OK, or the next
checkpoint arrives as a gateway.checkpoint event.
Keeping it signed in
GET /api/v1/accounts/{id} shows
where an account is at any time: status (OK, CREDENTIALS, CONNECTING, STOPPED)
and, under gateway, Swarmhit's own finer status and checkpoint. Branch on status.
- LinkedIn ended the session: the account turns
CREDENTIALS. Reconnect it withPOST /api/v1/accounts/{id}: same id, same device and IP. - Pause and resume an account with
…/pauseand…/resume: a paused account does nothing, and calls that act answer409 paused. - Placement: the account's IP is in the
countryyou sent (ISO code), else the country of theipyou sent, else of your server's address, elseUS. It keeps that IP for as long as it can;…/recoverpicks a new one in the same country when its exit stopped it.
What you can do with it
| Area | Start with |
|---|---|
| Conversations | List chats, start a chat, send a message, InMail and Sales Navigator threads |
| People | Read a profile, invite, connections, sent and received invitations |
| Posts | A member's posts, react, comment, publish |
| Search | People and Sales Navigator search, companies, InMail balance |
Use unless_replied_since on every automated follow-up: if the recipient wrote after
that time, nothing is sent and the call answers 409 recipient-replied.