A LinkedIn account connection API signs a member's account in from a server so that your product can act as that member. LinkedIn treats it like any new sign-in and can stop it at a checkpoint: an authenticator code, a code sent by email or SMS, an approval in the LinkedIn app, a phone number to register, or a CAPTCHA. Providers differ on three things: who answers the 2FA code (the person, every time, or a stored authenticator key), how a CAPTCHA reaches the person (a key your app must render, a wait, or a live view of the real sign-in browser), and whether the person signs in on a page that carries your brand.
We read the connection documentation of Swarmhit, Unipile, Edges and Linked API, and LinkedIn's own help on two-step verification, in November 2026. Account connection decides how often your users get asked to do something, and every request is a chance for them to give up.
What can LinkedIn ask for when an API signs in?
Each checkpoint type needs a different answer, and only some of them can be typed into an API call:
| Checkpoint | What LinkedIn wants | Can your code answer it? |
|---|---|---|
| 2FA | A 6-digit code from the member's authenticator app | Yes, with the code or with the authenticator key |
| OTP | A one-time code sent by email or SMS | Yes, once the person reads it to you |
| In-app validation | An approval tapped in the LinkedIn mobile app | No, the person approves on their phone |
| Phone register | A phone number to add to the account | Yes, the number with its dialling code |
| CAPTCHA | A puzzle LinkedIn renders on its own page | No, a person has to see it and solve it |
LinkedIn can also chain them, an OTP followed by a phone number for example, so a connection flow is a loop, not a single step. A step a provider does not recognise is the worst case: Swarmhit returns it as UNKNOWN, Edges sends LOGIN_FORM and UNKNOWN checkpoints to its support team, and neither can be typed.
Credentials, cookie or hosted page: which connection method?
Credentials, the member's email and password, let the provider sign in again whenever LinkedIn ends the session, which is what keeps an account working for months. The cost is that your product handles a LinkedIn password.
A cookie, the li_at value copied from a browser where the member is already signed in, skips the password and never triggers a checkpoint at connect time. Swarmhit's documentation spells out the catch: a browser session cannot re-establish itself, so when LinkedIn ends it, only a fresh li_at brings the account back. A cookie account is the one most likely to stop working on a Sunday and stay stopped until someone copies a new cookie.
A hosted page is the third way, and the usual one for products whose users connect their own accounts. Your backend asks the provider for a one-time link, the person signs in on the provider's page, and every checkpoint is answered there. Your servers never see the password. Swarmhit's page carries your organization's name and logo, Unipile's hosted wizard takes a brand name, a logo, a primary color and a custom domain, Edges generates hosted login links, and Linked API runs connection sessions where the person logs in themselves.
How does an authenticator key make 2FA automatic?
When a member turns on two-step verification with an authenticator app, LinkedIn shows a secret key to enter into the app, and the app turns it into the 6-digit codes, as LinkedIn's two-factor authentication help describes. Whoever holds that key can produce the same codes. A provider that stores it can answer every 2FA challenge itself, at connect time and on every later sign-in, instead of asking the person to open their app.
On Swarmhit this is the totpSecret field, and the sign-in then completes hands-free. The example below is from Swarmhit's sender accounts documentation:
curl -X POST https://app.swarmhit.com/api/v1/accounts \
-H "Authorization: Bearer swh_live_..." \
-H "Content-Type: application/json" \
-d '{
"username": "jane@example.com",
"password": "her-linkedin-password",
"totpSecret": "JBSWY3DPEHPK3PXP",
"country": "US"
}'An in-app approval request is first switched to the authenticator code, and the sender reconnects on its own later. Any other verification step in that mode fails with a 400 and code: unsupported-verification instead of leaving a half-connected account holding a seat, and a key that is not a valid authenticator secret fails with invalid-totp-secret. On the hosted page, the same option appears as "Keep it connected automatically". Unipile's connect reference has no authenticator-key field, and on Edges the 2FA checkpoint asks for the 6-digit code each time, so on both the person types every code.
How do you handle a LinkedIn CAPTCHA through an API?
A CAPTCHA cannot be typed into an API call, so every provider has to put a person in front of it. They do it in three ways.
Unipile hands your app the CAPTCHA provider's public key and data, and your front end renders the challenge itself. Its hosted wizard handles CAPTCHAs too, for teams that use it. Edges asks your code to poll the checkpoint until the challenge clears, and its documentation gives no way to show or answer the CAPTCHA. Swarmhit streams the sign-in itself: the response carries a live view token, and a websocket sends the real sign-in browser as JPEG frames while taking the person's clicks and keystrokes. The messages it exchanges look like this, with the person's typing sent as key and text messages:
{ "type": "frame", "data": "<jpeg>", "meta": {} }
{ "type": "state", "state": "live" }
{ "type": "mouse", "action": "<action>", "x": 412, "y": 288 }The live view does not depend on the challenge being a CAPTCHA. Whatever LinkedIn shows, an unknown step included, the person sees the actual page and acts on it inside your product. The token is single use and lasts 10 minutes, and a new one can be minted for the same account.
How do LinkedIn API providers compare on account connection?
| Swarmhit | Unipile | Edges | Linked API | |
|---|---|---|---|---|
| Connect methods | Credentials, li_at cookie, hosted link | Credentials, cookie, hosted wizard | Credentials, cookie, Chrome extension, hosted login link | Hosted connection session |
| 2FA | Answered from a stored authenticator key, or typed | Typed by the person each time | Typed by the person each time | Handled by the person on the hosted page |
| CAPTCHA | Live view of the real sign-in browser | Provider key and data for your app to render, or the hosted wizard | Poll until it clears | Handled by the person on the hosted page |
| Unknown steps | Live view | Not documented | Sent to support | Hosted page |
| Hosted page branding | Your organization's name and logo | Name, logo, color and a custom domain | Not documented | Configurable completion screen |
Unipile's hosted wizard is the most brandable of the four, down to a custom domain, which matters if your users must never see another company's URL. Swarmhit's difference is on the two requests that make people drop off: the 2FA code, which a stored key removes after the first connection, and the CAPTCHA or unknown step, which the live view brings into your own interface. The Unipile review, Edges review and Linked API review cover the rest of each product, and Swarmhit vs Unipile compares the two side by side.
What breaks in production?
An expired checkpoint. The symptom is a connection that never finishes because the person read the email code ten minutes later. On Swarmhit a checkpoint expires five minutes after LinkedIn asks, the answer then returns checkpoint_expired, and the attempt has to restart. Show a countdown, and offer to resend the code, which restarts the window.
An in-app approval nobody can reach. LinkedIn asks for approval in the mobile app of someone who is not at their phone. Swarmhit accepts TRY_ANOTHER_WAY as the answer to make LinkedIn offer a different method when it has one, and returns checkpoint_no_alternative when it does not.
A cookie account that cannot come back. A sender connected with li_at works until LinkedIn ends the session, then needs a person to copy a new cookie. For accounts that must stay up, connect with credentials and an authenticator key instead.
Retries that look like a new device. Every sign-in from a new place is a reason for LinkedIn to ask for more. Swarmhit's Raw API keeps each account on its own browser identity and sticky IP, and a refused connect retried later reuses the same device and IP. Check that your provider does the same before you retry in a loop, and read what to do after a restriction if an account gets flagged anyway.
Which approach should a product use?
If your users connect their own accounts, use the hosted page: you never store a LinkedIn password, and every checkpoint is the provider's problem. Offer the authenticator key on that page, because an account that can sign itself back in is an account that does not need its owner at the next session reset. Keep cookies for internal accounts that someone watches.
Swarmhit runs this connection layer on both of its APIs. On the Smart API, the connected account then joins sequences with email and WhatsApp, paced by the engine. On the Raw API, in early access, your code calls one endpoint per action, and the live view is part of the API. How LinkedIn's limits apply once the account is connected is covered in our guide to LinkedIn API rate limits, and the official routes are in the LinkedIn API guide.
FAQ
Can an API log in to LinkedIn?
Not through LinkedIn's official API, which lets members sign in to your app with OAuth but keeps messaging and invitations closed to most apps. Account-based providers sign the member's own account in from their servers, with credentials, a session cookie or a hosted page, and then act as that member. LinkedIn may ask for a checkpoint at that moment, and the provider has to bring the request to the person.
How do I get my LinkedIn authenticator key?
LinkedIn shows a secret key when you set up two-step verification with an authenticator app, the key you would otherwise enter in the app by hand. Save it when you see it. Given to a provider that supports it, such as Swarmhit through its totpSecret field or the "Keep it connected automatically" option on its hosted page, it lets the account answer 2FA by itself on every sign-in.
Is it safe to give an API my LinkedIn password?
It depends on what you need. A hosted page avoids it for products, because the person types the password on the provider's page and your servers never see it. A provider that stores credentials and an authenticator key can sign the account back in after LinkedIn ends a session, which a cookie cannot do. Swarmhit does not return credentials through its API and drops login secrets when an account is disconnected.
Why does LinkedIn ask for a verification code when an API connects?
Because the sign-in comes from a new device and place, LinkedIn checks that the member is really there. It may ask for an authenticator code, a code sent by email or SMS, an approval in its mobile app, or a CAPTCHA. Keeping each account on the same browser identity and IP across sign-ins, as Swarmhit does, avoids looking like a new device every time.
What happens if nobody answers a LinkedIn checkpoint?
The attempt times out. On Swarmhit the checkpoint expires five minutes after LinkedIn asks, the answer returns checkpoint_expired, and the account has to be reconnected to start a fresh attempt. A resend asks LinkedIn for a new code or approval push when the step supports it and restarts the five-minute window, which is often enough when the first email landed in spam.
Can a CAPTCHA be solved automatically through an API?
Swarmhit does not solve LinkedIn CAPTCHAs automatically, and neither do the providers compared here. A person has to see the puzzle. The differences are in where they see it: on a provider's hosted page, in a challenge your own front end renders from the provider's key and data, or in a live view of the real sign-in browser streamed into your product.




