Connect an account (cookie)
direct.lempile.com/api/v1/accountsConnects a LinkedIn account from its cookie, as Unipile's: no browser is ever opened for it. Lempile checks the cookie over HTTP with the browser's own user agent, language and timezone, through the account's own IP, keeps it encrypted and serves the account browserless. Keep using LinkedIn normally in that browser; signing out there ends the session (then connect again with a new cookie). Email and password go through hosted auth instead (POST /api/v1/hosted/accounts/link).
Authentication
X-API-KEY header·A Lempile Direct key, one per workspace, made in Lempile's dashboard.Request body
providerstringrequiredOne ofLINKEDINaccess_tokenstringrequiredThe li_at cookie of the browser the person is signed in with.
premium_tokenstringThe li_a cookie (Sales Navigator / Recruiter), when there is one.
user_agentstringrequiredThe exact user agent of the browser the cookies come from. Lempile replays it on every call: a different one makes LinkedIn end the session.
user_languagestringThat browser's language, e.g. fr-FR (or several, comma separated, in its order).
user_timezonestringThat browser's IANA timezone, e.g. Europe/Paris.
cookiesarray of objectrequiredLempile's own field (not Unipile's): every linkedin.com cookie of the browser li_at comes from, at least bcookie and JSESSIONID. li_at alone is refused (400 missing_browser_cookies): a new browser id for an existing session makes LinkedIn end it.
≤ 60 items›Show fieldsHide fields
namestringrequiredvaluestringrequireddomainstringpathstringexpiresnumberhttpOnlybooleansecureboolean
Responses
201Connected
›
application/json
objectstringrequiredaccount_idstringrequired
400A required parameter missing (errors/missing_parameters), or one that isn't valid (errors/invalid_parameters, errors/invalid_url, errors/content_too_large).
›
errors/missing_parameters), or one that isn't valid (errors/invalid_parameters, errors/invalid_url, errors/content_too_large).application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
401errors/missing_credentials: the X-API-KEY header is missing, wrong or revoked. errors/disconnected_account: LinkedIn signed the account out (or asks it for a security check); reconnect it.
›
errors/missing_credentials: the X-API-KEY header is missing, wrong or revoked. errors/disconnected_account: LinkedIn signed the account out (or asks it for a security check); reconnect it.application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
403LinkedIn refused it for this account (errors/resource_access_restricted, errors/action_required), or LinkedIn restricted the account (errors/account_restricted: every route answers it, with no LinkedIn call, until a person clears the restriction in Lempile), or the account doesn't write through Direct (errors/insufficient_permissions), or it needs Sales Navigator or Recruiter (errors/feature_not_subscribed).
›
errors/resource_access_restricted, errors/action_required), or LinkedIn restricted the account (errors/account_restricted: every route answers it, with no LinkedIn call, until a person clears the restriction in Lempile), or the account doesn't write through Direct (errors/insufficient_permissions), or it needs Sales Navigator or Recruiter (errors/feature_not_subscribed).application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
409errors/conflict: a write with this Idempotency-Key is still running.
›
errors/conflict: a write with this Idempotency-Key is still running.application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
501errors/feature_not_implemented: Direct doesn't do this (yet). A Unipile client can fall back to Unipile.
›
errors/feature_not_implemented: Direct doesn't do this (yet). A Unipile client can fall back to Unipile.application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
503errors/network_down: the account's proxy or browser server didn't answer. Nothing was sent.
›
errors/network_down: the account's proxy or browser server didn't answer. Nothing was sent.application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
504errors/request_timeout: LinkedIn didn't answer in time. On a write: an unknown outcome (it may have been sent); it's never retried and its Idempotency-Key never writes again.
›
errors/request_timeout: LinkedIn didn't answer in time. On a write: an unknown outcome (it may have been sent); it's never retried and its Idempotency-Key never writes again.application/json
titlestringrequiredA short title, e.g.
Too many requests.detailstringrequiredWhat happened, in plain words. Never an account's data.
typestringrequiredUnipile's error type:
errors/<kind>. Branch on this, not ondetail.statusintegerrequiredThe HTTP status again.
retry_afterintegerSeconds to wait before trying this account again. Only on 429; the
Retry-Afterheader carries the same value.account_statusstringLempile's own field, on a problem about the account's state (401
errors/disconnected_account, 403errors/account_restricted, 503 or 422errors/network_down, 504errors/request_timeout): the account'slifecycle.status(see Account). Thetypeand HTTP status stay Unipile's.One ofrunningdegradederroreddisconnectedconnectingreasonstringWith
account_status: why, aslifecycle.reason(signed_out,checkpoint,restricted,proxy_unavailable,browser_unavailable,timeout,lempile_error).
Was this page helpful?