Create a post
direct.lempile.com/api/v1/postsPublishes a post (public, comments open), with mentions, a link, up to 20 images or one video, as the member or as a page. Files are uploaded first (multipart). With repost: a repost (LinkedIn's instant repost, or with text a repost with those words).
Authentication
X-API-KEY header·A Lempile Direct key, one per workspace, made in Lempile's dashboard.Query parameters
account_idstringThe account that writes, when the body doesn't name it.
dry_runbooleantrue: answer the write's plan (DryRun, 200) and send nothing to LinkedIn.Defaultfalse
Headers
Idempotency-KeystringThe same key (per account) never writes twice: a repeat answers the first answer for 7 days; a repeat while the first runs answers 409.
≥ 1 chars · ≤ 200 chars
Request body
account_idstringrequiredThe account that writes (or
?account_id=). Required.textstringrequired3,000 characters at most (mentions' names and an added link count).
mentionsarray of objectPlaced in
textwith{{0}},{{1}}… Every mention must be placed.›Show fieldsHide fields
namestringrequiredThe text shown.
profile_idstringrequiredA person's provider id (
ACo…) or a company's id (digits).is_companyboolean
external_linkstringAn http(s) link, added at the end of the text unless it's already in it.
as_organizationstringWrite as this company page (its id, digits). The account must be an admin of the page.
attachmentsarray of string · binaryUp to 20 images (jpg, png, gif, webp; 36 MB each) or one video (75 KB to 5 GB).
video_thumbnailstring · binaryAn image for the video.
repoststringA post's id to repost. With no
text(or an empty one): LinkedIn's instant repost (as a page withas_organization). Withtext: a repost with those words (mentions and link as for a post; no files).include_job_postingstringAnswers 501.
targeted_audiencestringAnswers 501.
account_idstringrequiredThe account that writes (or
?account_id=). Required.textstringrequired3,000 characters at most (mentions' names and an added link count).
mentionsarray of objectPlaced in
textwith{{0}},{{1}}… Every mention must be placed.›Show fieldsHide fields
namestringrequiredThe text shown.
profile_idstringrequiredA person's provider id (
ACo…) or a company's id (digits).is_companyboolean
external_linkstringAn http(s) link, added at the end of the text unless it's already in it.
as_organizationstringWrite as this company page (its id, digits). The account must be an admin of the page.
attachmentsarray of string · binaryUp to 20 images (jpg, png, gif, webp; 36 MB each) or one video (75 KB to 5 GB).
video_thumbnailstring · binaryAn image for the video.
repoststringA post's id to repost. With no
text(or an empty one): LinkedIn's instant repost (as a page withas_organization). Withtext: a repost with those words (mentions and link as for a post; no files).include_job_postingstringAnswers 501.
targeted_audiencestringAnswers 501.
Responses
200With ?dry_run=true: the write's plan. Nothing is sent.
›
?dry_run=true: the write's plan. Nothing is sent.application/json
objectstringrequiredAlwaysDryRunroutestringrequiredDirect's name for the write, e.g.
chats.message,posts.create,chats.start.inmail.methodstringrequiredThe HTTP method of LinkedIn's call.
pathstringrequiredLinkedIn's own endpoint the write would call (
/voyager/api/...).bodyobject | nullrequiredThe exact body LinkedIn would get. Files appear as
$upload:Nuntil uploaded; an invitation's shared secret is masked.statusintegerrequiredThe status the real write answers (200, 201 or 204).
uploadsarray of objectEach file's registration with LinkedIn's uploader, in order.
›Show fieldsHide fields
methodstringpathstringbodyobjectthenstringcontent_typestringfileobjectA voice note: its length (
duration_ms), what it came as (from, container/codec) and whether its AAC audio was kept or encoded (audio).
multiphotoobjectSeveral images on one post: the call that groups them.
›Show fieldsHide fields
methodstringpathstringbodyobject
checkedarray of stringWhat Direct read to plan it (e.g.
profile relationship,compose option,post author).
201Created
›
application/json
objectstringrequiredAlwaysPostCreatedpost_idstringrequiredThe new post's activity id (or its ugcPost/share urn while LinkedIn hasn't given an activity).
idstringrequiredSame as
post_id.share_urlstring
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.
403LinkedIn refused it for this account (errors/resource_access_restricted, errors/account_restricted, errors/action_required), 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/account_restricted, errors/action_required), 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.
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.
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.
422A write LinkedIn refuses, or that the checks before it refuse: errors/already_connected, errors/already_invited_recently, errors/cannot_invite_attendee, errors/invalid_recipient, errors/cannot_resend_yet, errors/limit_exceeded, errors/connection_limit_reached, errors/no_connection_with_recipient, errors/not_allowed_inmail, errors/insufficient_credits, errors/invalid_post, errors/unprocessable_entity, errors/invalid_parameters, errors/invalid_message (a voice note over 60 seconds), errors/action_already_performed (a message already deleted), errors/not_supported_by_provider.
›
errors/already_connected, errors/already_invited_recently, errors/cannot_invite_attendee, errors/invalid_recipient, errors/cannot_resend_yet, errors/limit_exceeded, errors/connection_limit_reached, errors/no_connection_with_recipient, errors/not_allowed_inmail, errors/insufficient_credits, errors/invalid_post, errors/unprocessable_entity, errors/invalid_parameters, errors/invalid_message (a voice note over 60 seconds), errors/action_already_performed (a message already deleted), errors/not_supported_by_provider.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.
429errors/too_many_requests: LinkedIn asked the account to slow down (it rests 15 minutes), its daily calls or writes are used up, or it's busy with other calls. Wait retry_after seconds.
›
errors/too_many_requests: LinkedIn asked the account to slow down (it rests 15 minutes), its daily calls or writes are used up, or it's busy with other calls. Wait retry_after seconds.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.
500errors/provider_error: LinkedIn answered something Direct couldn't read (nothing was written). errors/unexpected_error: Direct failed.
›
errors/provider_error: LinkedIn answered something Direct couldn't read (nothing was written). errors/unexpected_error: Direct failed.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.
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.
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.
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.
Was this page helpful?