Skip to content
Docs

Create a hosted auth link

POSTdirect.lempile.com/api/v1/hosted/accounts/link

A 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

  • typestringrequired

    create connects a new LinkedIn account; reconnect signs an existing one in again.

    One ofcreatereconnect
  • api_urlstringrequired

    Required, as on Unipile (any non-empty string; Direct doesn't use it).

  • providersone of

    Required for create: one provider, a category or a list, taking LinkedIn ("LINKEDIN", ["LINKEDIN"], "*", "*:MESSAGING"). Optional for reconnect; when given, it must take LinkedIn too.

    ›Show fields
    • Option 1array of string
    • Option 2string
      One ofLINKEDIN**:MESSAGING
  • expiresOnstringrequired

    ISO 8601 UTC time (YYYY-MM-DDTHH:MM:SS.sssZ), in the future. The link lasts 24 hours at most, whatever this says.

  • namestring

    Your own reference (1 to 500 characters), sent back in notify_url's body.

  • reconnect_accountstring

    The account id to reconnect (one of the key's workspace, served or removed). Required for reconnect.

  • success_redirect_urlstring

    Where the person lands once the account is connected and checked (https).

  • failure_redirect_urlstring

    Where the person lands after a cancel, a failure, or a session that doesn't work (https).

  • notify_urlstring

    Direct POSTs {status, account_id, name} here once the account works (https; put your own secret in it).

  • bypass_success_screenboolean

    Accepted; no effect (Direct redirects at once when success_redirect_url is set).

Responses

200

OK

›

application/json

  • objectstringrequired
    AlwaysHostedAuthUrl
  • urlstringrequired

    https://direct.lempile.com/connect/<token>: send the person there.

400

A required parameter missing (errors/missing_parameters), or one that isn't valid (errors/invalid_parameters, errors/invalid_url, errors/content_too_large).

›

application/json

  • titlestringrequired

    A short title, e.g. Too many requests.

  • detailstringrequired

    What happened, in plain words. Never an account's data.

  • typestringrequired

    Unipile's error type: errors/<kind>. Branch on this, not on detail.

  • statusintegerrequired

    The HTTP status again.

  • retry_afterinteger

    Seconds to wait before trying this account again. Only on 429; the Retry-After header carries the same value.

401

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

  • titlestringrequired

    A short title, e.g. Too many requests.

  • detailstringrequired

    What happened, in plain words. Never an account's data.

  • typestringrequired

    Unipile's error type: errors/<kind>. Branch on this, not on detail.

  • statusintegerrequired

    The HTTP status again.

  • retry_afterinteger

    Seconds to wait before trying this account again. Only on 429; the Retry-After header carries the same value.

404

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

  • titlestringrequired

    A short title, e.g. Too many requests.

  • detailstringrequired

    What happened, in plain words. Never an account's data.

  • typestringrequired

    Unipile's error type: errors/<kind>. Branch on this, not on detail.

  • statusintegerrequired

    The HTTP status again.

  • retry_afterinteger

    Seconds to wait before trying this account again. Only on 429; the Retry-After header carries the same value.

Was this page helpful?