Skip to main content

LinkedIn

LinkedIn posting uses an OAuth access token and a member or organization identity.

Content support

CapabilitySupport
TextUp to 3000 characters.
ImagesUp to 9 images.
VideoOne video.
Mixed mediaNot supported.
Empty postsNot allowed; provide text or media.

Set up credentials

  1. Create a LinkedIn app in the LinkedIn Developer portal.
  2. Request the products and permissions needed for posting (w_member_social, plus openid, profile, email if you need login data).
  3. Configure OAuth redirect URIs for your app or Scheduler deployment.
  4. Run the OAuth authorization flow.
  5. Store the access token and member ID or page/organization ID.
  6. Confirm the token has posting permissions before using it in automation.

The CLI does not bundle a LinkedIn OAuth app. To use it from the CLI, supply your own client secret through SIMPLE_POST_LINKEDIN_CLIENT_SECRET before running simplepost account add linkedin.

Environment variables

LINKEDIN_ACCESS_TOKEN=
LINKEDIN_MEMBER_ID=

Both variables must be set together.

SDK options

await post({
content: {
text: "Posting to LinkedIn",
media: [{ type: "image", path: "./photo.jpg" }],
},
platforms: ["linkedin"],
options: {
linkedin: {
visibility: "PUBLIC",
},
},
});

visibility can be:

  • PUBLIC
  • CONNECTIONS

REST server account

Add this entry under accounts in the self-hosted REST server's accounts.json:

{
"id": "linkedin-page",
"platform": "linkedin",
"credentials": {
"accessToken": "...",
"memberId": "..."
},
"options": {
"visibility": "PUBLIC"
}
}