Tesselith
ProductSolutionsAI agentsCompareFree toolsBlogPricing
Log inStart free
  1. Home/
  2. Blog/
  3. Posting to LinkedIn via API in 2026: the Posts API, Versioned Headers, Images, and Personal vs Company Pages

Developers

Posting to LinkedIn via API in 2026: the Posts API, Versioned Headers, Images, and Personal vs Company Pages

November 27, 2026 · 7 min read

How to post to LinkedIn via API in 2026: the Posts API, the LinkedIn-Version header, image and PDF uploads, personal vs company scopes, and the errors to expect.

To post to LinkedIn via API, send `POST https://api.linkedin.com/rest/posts` with three headers: your bearer token, `LinkedIn-Version: YYYYMM`, and `X-Restli-Protocol-Version: 2.0.0`. The body names an author URN (a person or an organization), the post text in commentary, and fixed visibility, distribution and lifecycleState fields. LinkedIn answers 201 with an empty body and puts the new post's URN in the x-restli-id response header. Posting as yourself needs the w_member_social scope. Posting as a company page needs w_organization_social and an admin or content-admin role on that page.

Key takeaways

  • Use the Posts API (/rest/posts). It replaces ugcPosts.
  • Every call needs a LinkedIn-Version header. The latest is 202611, and each version is supported for at least a year.
  • The post id comes back in the x-restli-id header, not the body.
  • LinkedIn never fetches media from a URL. Upload images, video and PDFs first, then reference their URNs.
  • Commentary uses little text format: escape reserved characters with a backslash or text gets cut off.

Personal profile vs company page: two different apps

This is the decision that shapes everything else, so make it first.

Personal profileCompany page
Author URNurn:li:person:{id}urn:li:organization:{id}
Write scopew_member_socialw_organization_social
LinkedIn productShare on LinkedIn (self-serve)Community Management API (application and review)
Who can grant itAny memberMembers with ADMINISTRATOR, CONTENT_ADMIN or DIRECT_SPONSORED_CONTENT_POSTER role
Read own postsr_member_social (restricted, approved apps only)r_organization_social
Sign-in scopesopenid profile emailSame, plus the org scopes

Share on LinkedIn is self-serve: add the product to your app and you can post to the signed-in member's profile the same day. The Community Management API is a separate application, and LinkedIn wants it on its own developer app. We run two LinkedIn apps for exactly that reason: one for personal profiles, one for company pages. Plan the review time into your schedule.

Get the member's person id from the OpenID Connect userinfo endpoint (GET https://api.linkedin.com/v2/userinfo, the sub field). The old r_liteprofile and r_emailaddress scopes were retired, so tutorials that request them get an invalid scope error. For organizations, list the pages a member administers with GET /rest/organizationAcls?q=roleAssignee.

The LinkedIn-Version header

LinkedIn's versioned APIs ship monthly. The header value is the release year and month, and as of November 2026 the latest is 202611. Each version is supported for a minimum of one year, then sunset. The January 2026 version (202601) sunsets on January 15, 2027. Send a missing or sunset version and you get an error, not a fallback, because LinkedIn never applies the latest version by default.

Practical rule: keep the version in one constant, put a calendar reminder for eleven months after you last bumped it, and read the changelog for the resources you use before bumping. Paths rarely change between versions. Field behavior sometimes does.

A text post, end to end

curl -i -X POST "https://api.linkedin.com/rest/posts" \
  -H "Authorization: Bearer $LINKEDIN_TOKEN" \
  -H "LinkedIn-Version: 202611" \
  -H "X-Restli-Protocol-Version: 2.0.0" \
  -H "Content-Type: application/json" \
  -d '{
    "author": "urn:li:organization:5515715",
    "commentary": "We are hiring two backend engineers in Lisbon.",
    "visibility": "PUBLIC",
    "distribution": {
      "feedDistribution": "MAIN_FEED",
      "targetEntities": [],
      "thirdPartyDistributionChannels": []
    },
    "lifecycleState": "PUBLISHED",
    "isReshareDisabledByAuthor": false
  }'

# HTTP/2 201
# x-restli-id: urn:li:share:7200000000000000000

Read the URN from the header. Code that calls res.json() on a 201 and looks for an id finds an empty body and decides the post failed, then retries, and now there are two posts. Use -i with curl while you're testing so you can see the header. The URN may be a urn:li:share: or a urn:li:ugcPost:. Store whatever comes back and don't parse meaning from the prefix.

Little text format: the escaping bug everyone hits

The commentary field isn't plain text. It's LinkedIn's little text format, where some characters have meaning: @[Name](urn:li:organization:123) is a mention and #word is a hashtag. The reserved characters are | { } @ [ ] ( ) < > # \ * _ ~. If they appear in ordinary text unescaped, LinkedIn can drop or truncate the text after them. The symptom is a post that ends mid-sentence right before a bracket.

const RESERVED = /[|{}@\[\]()<>#\\*_~]/g

// Escape user text once, right before building the request body.
export function escapeLittleText(text: string): string {
  return text.replace(RESERVED, (ch) => "\\" + ch)
}

// "Q3 results (draft) are in" -> "Q3 results \(draft\) are in"

Escape once. Escaping twice publishes visible backslashes. And escaping is separate from JSON encoding: your JSON library will turn each backslash into two in the wire format, which is correct. If you want hashtags and mentions to work, escape the plain text and then insert the mention or hashtag syntax yourself. A mention only links if the text in the brackets matches the organization's name exactly (members can match on first or last name).

Images, video and PDFs: upload first

Unlike Meta, LinkedIn won't fetch a URL for you. Every asset is three calls: initialize an upload to get an upload URL and an asset URN, PUT the bytes, then reference the URN in the post.

# 1. Initialize
curl -X POST "https://api.linkedin.com/rest/images?action=initializeUpload" \
  -H "Authorization: Bearer $LINKEDIN_TOKEN" \
  -H "LinkedIn-Version: 202611" \
  -H "X-Restli-Protocol-Version: 2.0.0" \
  -H "Content-Type: application/json" \
  -d '{"initializeUploadRequest": {"owner": "urn:li:organization:5515715"}}'

# -> {"value": {"uploadUrl": "https://www.linkedin.com/dms-uploads/...", "image": "urn:li:image:C4E10AQ..."}}

# 2. Upload the bytes
curl -X PUT "$UPLOAD_URL" \
  -H "Authorization: Bearer $LINKEDIN_TOKEN" \
  --upload-file chart.png

# 3. Reference it in the post body
#   "content": {"media": {"id": "urn:li:image:C4E10AQ...", "altText": "Bar chart of Q3 signups"}}

The owner must match the post's author. An image uploaded as the member can't be attached to a company post. Videos use /rest/videos and documents use /rest/documents with the same pattern (large videos come back with several upload URLs to PUT in parts, then a finalize call).

Content typeBody shapeNotes (LinkedIn docs, Nov 2026)
Single imagecontent.media.id = urn:li:imageAdd altText
Multiple imagescontent.multiImage.images[]2 to 20 images, organic only
Videocontent.media.id = urn:li:videoOne per post
Document (PDF)content.media.id = urn:li:documentRenders as the swipeable 'carousel' people mean
Article / linkcontent.article with source, title, thumbnailNo URL scraping: you supply title and thumbnail
Carousel (card)Not available organicallySponsored posts only

Two of those surprise people. First, the organic "carousel" everyone talks about is a PDF document post. The Carousel API is for ads. Second, link posts don't get a preview generated from the URL. The Posts API won't scrape it. Upload a thumbnail through the Images API and set title, description and thumbnail on the article yourself, or the link shows up bare.

A post has one content block. You can't mix images and a video, or attach a PDF and an image together. Validate that before uploading anything, because uploads you never use still count against your limits.

Tokens and rate limits

LinkedIn access tokens last 60 days. Refresh tokens aren't issued to every app, so check whether your token response includes one. If it doesn't, the member has to re-authorize before day 60, and your product needs a reconnect prompt that appears a week or two ahead, not on the day posts start failing.

LinkedIn doesn't publish standard rate limits. There's an application-wide daily limit and a per-member daily limit, both resetting at midnight UTC, and you can see the actual numbers for each endpoint in the Analytics tab of your app in the Developer Portal. Exceed them and you get 429 TOO_MANY_REQUESTS. For a scheduler this rarely bites on posting. It bites on analytics polling, so poll post stats sparingly.

Errors and what to do with them

StatusCodeUsual causeRetry?
400INVALID_URN_TYPE / MISSING_FIELDWrong URN type for author or media, or a required field missingNo
400FIELD_LENGTH_TOO_LONGCommentary over the limitNo
401EMPTY_ACCESS_TOKENMissing or expired tokenRefresh, then no
403ACCESS_DENIEDMissing scope, or member lost their page roleNo. Ask for reconnection
409CONFLICTWrite conflictYes
422UNPROCESSABLE_ENTITYSemantically invalid contentNo
429TOO_MANY_REQUESTSDaily limit hitYes, after reset
500 / 503Server errorsLinkedIn's sideYes, with backoff

A 403 on a company page that worked last week usually means the person who connected it lost their admin role. Reconnecting as the same person won't help. Someone who is still an admin has to connect it.

Commenting and first comments

To add a first comment (for the link people tell you to keep out of the post body), POST to /rest/socialActions/{encoded post URN}/comments with an actor URN and message.text. URL-encode the URN in the path: urn:li:share:123 becomes urn%3Ali%3Ashare%3A123. Commenting as an organization uses the same w_organization_social scope as posting.

If you're scheduling rather than coding, our guide to scheduling LinkedIn posts covers the workflow, and the LinkedIn character counter checks length before you send.

When to use a scheduling API instead of building it yourself

Posting a text update is easy. Running LinkedIn in production means two developer apps, a Community Management review, version bumps every year, little-text escaping, three-step uploads, and reconnect flows for 60-day tokens. If LinkedIn is one network among several, that's a lot of surface for one channel.

LinkedIn is coming soon to Tesselith. Today the Tesselith API publishes to Instagram, Facebook Pages, Threads, YouTube, Bluesky, Mastodon and Telegram through one post model with idempotency keys and webhooks. Our checklist for choosing a scheduling API and the automation walkthrough help you compare options, and the docs show the requests.

Questions people ask

Which LinkedIn API do I use to create posts?
The Posts API at POST https://api.linkedin.com/rest/posts. It replaces the older ugcPosts API and needs the LinkedIn-Version and X-Restli-Protocol-Version headers on every call.
Where is the post id in the LinkedIn API response?
In the x-restli-id response header. A successful create returns 201 with an empty body.
Can I post to a LinkedIn company page with the API?
Yes, with the w_organization_social scope from the Community Management API, as a member who holds an administrator, content admin or sponsored content poster role on the page.
What is the current LinkedIn-Version header?
202611 (November 2026) is the latest. LinkedIn releases a version monthly and supports each for at least one year.
Why is my LinkedIn API post cut off?
Unescaped reserved characters in little text format, such as parentheses or brackets. Escape | { } @ [ ] ( ) < > # \ * _ ~ with a backslash.
How do I make a LinkedIn carousel post via API?
Upload a PDF through the Documents API and attach it as content.media. Organic card carousels aren't supported; the Carousel API is for sponsored content.

Try Tesselith free

Connect your channels and schedule your first post in minutes. No credit card required.

Start free

Related pages

How to schedule LinkedIn postsTesselith REST APILinkedIn character counterChoosing a social media scheduling API

More from the blog

Uploading Video with the YouTube Data API in 2026: Resumable Uploads, Quota Costs and the End of the Private LockPosting to Bluesky via the AT Protocol API: createRecord, Facets, Images, Video and ThreadsPosting to Mastodon via the API: Statuses, Media, Idempotency-Key and scheduled_atThreads API Publishing in 2026: Containers, Carousels, Reply Chains and Limits

Free to start

One calendar for everything you post.

No credit card. Connect your first channel and schedule a post in under two minutes.

Start free
Tesselith

The social scheduler for creators, teams and agencies. One calendar, every network you post to.

Product

  • Composer
  • Calendar
  • Analytics
  • Automation
  • AI assistant
  • Posting queue
  • API & webhooks
  • MCP server
  • All features

AI agents

  • Claude
  • Claude Code
  • ChatGPT
  • Codex
  • Cursor
  • Gemini CLI
  • n8n
  • All AI agents

Solutions

  • Creators
  • Agencies
  • Small business
  • E-commerce
  • All solutions

Compare

  • Scheduler pricing 2026
  • vs Buffer
  • vs Hootsuite
  • Metricool alternatives
  • Planoly alternatives
  • SocialBee alternatives
  • All comparisons
  • All alternatives

Free tools

  • Character counter
  • Best time to post
  • UTM builder
  • Engagement rate
  • All tools

Company

  • About
  • Blog
  • Research
  • Developer docs
  • Pricing
  • Contact
  • Security
  • Status

Legal

  • Privacy
  • Terms
  • Cookies
  • Acceptable Use
  • DPA
  • Refunds

Schedule posts for

  • X (Twitter)
  • Instagram
  • Facebook Pages
  • LinkedIn
  • YouTube
  • TikTok
  • Threads
  • Bluesky
  • Mastodon
  • Pinterest
  • Reddit
  • Discord
  • Telegram
  • Dev.to
  • Hashnode

Popular guides

  • Post to all social media at once
  • Schedule Discord messages
  • Cross-post to Bluesky, Mastodon and Threads
  • Buffer pricing
  • Sprout Social pricing
  • Metricool pricing
  • Sendible pricing
  • Loomly pricing
© 2026 Tesselith. All rights reserved.
PrivacyTermsCookiesSecurityData deletion
Tesselith