Create a hosted auth link
direct.lempile.com/api/v1/hosted/accounts/linkA link to a page where a person connects (or reconnects) their LinkedIn account through Lempile's own real-browser sign-in, checkpoints included. When they're back, Direct serves the account, checks it, POSTs notify_url, sends the account_status webhooks and redirects to success_redirect_url. A new account joins the key's workspace; a reconnect is for one of its accounts only.
Authentication
X-API-KEY header·A Lempile Direct key, one per workspace, made in Lempile's dashboard.Request body
typestringrequiredcreateconnects a new LinkedIn account;reconnectsigns an existing one in again.One ofcreatereconnectapi_urlstringrequiredRequired, as on Unipile (any non-empty string; Direct doesn't use it).
providersone ofRequired for
create: one provider, a category or a list, taking LinkedIn ("LINKEDIN",["LINKEDIN"],"*","*:MESSAGING"). Optional forreconnect; when given, it must take LinkedIn too.›Show fieldsHide fields
Option 1array of stringOption 2stringOne ofLINKEDIN**:MESSAGING
expiresOnstringrequiredISO 8601 UTC time (
YYYY-MM-DDTHH:MM:SS.sssZ), in the future. The link lasts 24 hours at most, whatever this says.namestringYour own reference (1 to 500 characters), sent back in
notify_url's body.reconnect_accountstringThe account id to reconnect (one of the key's workspace, served or removed). Required for
reconnect.success_redirect_urlstringWhere the person lands once the account is connected and checked (https).
failure_redirect_urlstringWhere the person lands after a cancel, a failure, or a session that doesn't work (https).
notify_urlstringDirect POSTs
{status, account_id, name}here once the account works (https; put your own secret in it).bypass_success_screenbooleanAccepted; no effect (Direct redirects at once when
success_redirect_urlis set).
Responses
200OK
›
application/json
objectstringrequiredAlwaysHostedAuthUrlurlstringrequiredhttps://direct.lempile.com/connect/<token>: send the person there.
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.
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.
404errors/resource_not_found: an unknown or removed account, an account of another workspace (answered exactly the same), or nothing on LinkedIn with this id.
›
errors/resource_not_found: an unknown or removed account, an account of another workspace (answered exactly the same), or nothing on LinkedIn with this id.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.
Was this page helpful?