Skip to content

Add an account with its login

Most teams connect an account by sending the rep to a Linnia page (connectUrl from POST /v1/accounts/connect), so the login never passes through their code. This page is for the other case: your system already holds the login, and you want an account working without anyone opening a browser.

One call does it:

Terminal window
curl -X POST https://api.linnia.ai/v1/accounts/connect/credentials \
-H "Authorization: Bearer lin_…" -H "content-type: application/json" \
-d '{
"username": "emma@example.com",
"password": "…",
"totpSecret": "JBSW Y3DP EHPK 3PXP JBSW Y3DP EHPK 3PXP",
"proxy": "http://user:pass@198.51.100.7:9000",
"timezone": "Europe/Berlin"
}'

Linnia takes a seat, pins the proxy to the account, signs in, and answers LinkedIn’s two-step prompt with the current code from the authenticator secret. The call can take up to a minute.

For this to run with nobody present, the account’s two-step verification must use an authenticator app, not SMS. When LinkedIn asks for a tap in its phone app instead, Linnia asks it for another way and answers the authenticator prompt if LinkedIn offers one.

Field
username, password The LinkedIn login. Required.
totpSecret The account’s authenticator secret: the base32 key LinkedIn shows when two-step verification is set up with an authenticator app (spaces and dashes are ignored), or the whole otpauth://totp/… link. Optional; without it a 2FA prompt comes back to you as a checkpoint.
proxy One proxy for this account: scheme://user:pass@host:port (http, https or socks5), host:port:user:pass or host:port. Optional.
country Two-letter country the account usually signs in from. Only used when the account has no proxy of its own.
label, timezone, workingHours As on POST /v1/accounts/connect. The label names the account until it connects; after that it goes by the person’s LinkedIn name.

201, status: "connected". The account is signed in. account is the full account, proxy is the proxy pinned to it (never its password). An account.connected webhook fires as well.

202, status: "checkpoint". LinkedIn wants something only a person can give. The account exists and holds its seat; finish it with the calls next names:

checkpoint.type Finish with
OTP (a code by email or SMS) POST /v1/accounts/{id}/native-checkpoint with { providerAccountId, code }
2FA (no totpSecret was sent, or LinkedIn sent the code by SMS) The same call, with the code
IN_APP_VALIDATION (LinkedIn would not switch to the authenticator) Approve in the LinkedIn app, then POST /v1/accounts/{id}/native-poll with { providerAccountId } until it answers connected
CAPTCHA A person, on the account’s connect page in the dashboard

checkpoint.providerAccountId is the value those calls expect.

An error. The request is checked before a seat is taken, and a sign-in LinkedIn refuses (a wrong password, a rejected code) gives the seat and the proxy back, so you can simply call again. The usual ones:

Error Why
invalidParams The authenticator secret or the proxy is not valid, or that proxy is already used by another account. Each account needs its own.
notAllowed Every seat is in use, or custom proxies are not enabled for your workspace.

An account keeps one proxy for life, so LinkedIn always sees it from the same address. The proxy you send joins your workspace’s proxy pool (GET /v1/proxy lists it) already assigned to this account. Sending a proxy that sits free in the pool claims it.

Custom proxies are off until Linnia enables them for a workspace; ask us. Without one, the account takes a free proxy from your pool if there is one, else Linnia’s own.

LinkedIn signs sessions out from time to time, and account.reconnection_required tells you when. Sign the same account back in with:

Terminal window
curl -X POST https://api.linnia.ai/v1/accounts/{id}/native-auth \
-H "Authorization: Bearer lin_…" -H "content-type: application/json" \
-d '{"username":"emma@example.com","password":"…","totpSecret":"JBSW Y3DP EHPK 3PXP JBSW Y3DP EHPK 3PXP"}'

It takes the same totpSecret, and proxy if the account should move to a different one. It answers kind: "connected" or kind: "checkpoint".

A new account starts a 15-day warm-up with small budgets, and in approve mode, where every write waits for a person. Set its working hours, mode and limits with PATCH /v1/accounts/{id} and PUT /v1/accounts/{id}/limits. See Safety and limits.