LinkedIn: can’t post to personal or company feed (UGC v2 & REST both failing) – need help with LinkedIn-Version / Person URN”

Hey n8n friends! :wave:
I’m Adam, a product-manager moonlighting as an automation tinkerer, and I’ve hit a wall trying to publish LinkedIn posts from n8n. I’ve burned the better part of an evening on this, so I’m laying out the full saga in hopes someone can spot what I’m missing.


Setup

• n8n Cloud v1.90.1
• HTTP Request node v4.2
• LinkedIn OAuth2 credential shows scopes openid, profile, w_member_social
• LinkedIn app has Sign-in with LinkedIn (OIDC) and Share on LinkedIn enabled
• Person URN I’m posting as: urn:li:person:xxxxx (from /v2/userinfo)
• Company Page URN I admin: urn:li:organization:123456
• My n8n login email ≠ LinkedIn email, but I authenticate with the correct LI profile during OAuth.


What I tried

  1. UGC Posts v2 (/v2/ugcPosts)
    • Body: LinkedIn’s sample with my Person URN.
    • Header: LinkedIn-Version: 202504 (also tried older ones).
    • Result: 422 – “author … does not match urn:li:company|member”.
    • Same 422 when I swapped in the org URN.
    • Realised UGC wants the old numeric urn:li:member:<digits> ID that the modern API doesn’t expose.
  2. REST Posts (/rest/posts)
    Body used LinkedIn’s new format:

json

CopyEdit

{
  "author": "urn:li:person:xxxx",   // also tried org URN
  "commentary": "Posting via n8n 🚀",
  "lifecycleState": "PUBLISHED",
  "visibility": "PUBLIC",
  "distribution": { "feedDistribution": "MAIN_FEED" }
}

Tried every header combo I could think of:
– No LinkedIn-Version → 400 VERSION_MISSING
– 202504 → 403 Forbidden
– 202402, 202401, 202310, 202306 → 426 NONEXISTENT_VERSION every time.
Exactly the same results whether the author is a person URN or an organization URN.
3. Sanity checks
/v2/userinfo with the same token returns my profile (so token is valid).
• OAuth credential re-connected after adding Share-on-LinkedIn; consent screen shows “post, comment and react on your behalf.”
• Removed any hidden whitespace from header names.
• Tried the same calls with raw cURL outside n8n – identical 400/403/426 chain.


Where I’m stuck

  • UGC v2 demands a numeric member URN I can’t obtain.
  • REST refuses every version I give it, but also refuses if I omit the header.
  • Both personal and company posts fail, so it feels like a global version or permission mismatch.

What I’m asking for

  1. Has anyone posted to any LinkedIn feed (personal or company) via /rest/posts in 2024/25?
  2. Which LinkedIn-Version values are actually accepted right now?
  3. Is there any documented way to fetch the numeric urn:li:member:<digits> ID, or is that strictly partner-API territory now?
  4. Is there an n8n node or community package that already handles LinkedIn posting without all this header drama?

Screenshots, working cURL, random theories—everything helps. Thanks a ton in advance!

1 Like

@Adam_Cohen I’m in the same camp—it seems that the native LinkedIn node does not work at all for me.

1 Like

Same. I lost an entire day only to find out I’m not alone. Relieved. Is there a workaround?

1 Like

same here stayed up whole night for nothing and now i have to do my pending work from day job and head towards office after 7 cups of coffee

Maybe you have been able to resolve this now at least for the company URN. I am able to post alright using that option but using the “person“ instead of “organization“ for some reason does not work. It does not give me the option to choose even select the name. Not sure that functionality exists right now even though the UI does.

I’ll be happy to get assistance on that if someone already figured it out.

Hi All

I Finally figured out how to repost on Linkedin, on personal and company accounts

First you need the URN of the personal profile and organization

Personan URN, you need normal scopes, you dont need any special scopes here (openid
profile, w_member_social, email) for your linked in APP

curl --location ‘https://api.linkedin.com/v2/userinfo’ \
–header ‘Linkedin-version: 202505’ \
–header ‘Authorization: Bearer ‘Use your toen here’ \

This will return a response

{
“sub”: “X-jikrs”,
“email_verified”: true,
“name”: “Your Name”,
“locale”: {
“country”: “US”,
“language”: “en”
},
“given_name”: “Your”,
“family_name”: “Name”,
“email”: “[email protected]”,
“picture”: “https://media.licdn.com/dms/image/v2/xxxxx”
}

This sub field is the URN in this case X-jikrs

Now to repost on your personal profile, any post, you need to make a custom http node in n8n and pass it with linkedin credentials like the below

  1. POST Request to https://api.linkedin.com/v2/ugcPosts

  2. Credentials use Linked API Predefined Crdentials, (easier you dont need to define bearer token in the request)

  3. Headers to pass

    1. Content-Type : application/json
    2. X-Restli-Protocol-Version: 2.0.0
    3. LinkedIn-Version: 202507
  4. Send Json body as below (replace the “urn:li:person:X-jikrs" and “parent”: “urn:li:share:7361xxxxx”, and “root”: “urn:li:share:7361xxxxx” fields with corect urn:li:share

    {“author”: “urn:li:person:X-jikrs”,“specificContent”: {“com.linkedin.ugc.ShareContent”: {“shareCommentary”: {“text”: “”},“shareMediaCategory”: “NONE”}},“responseContext”: {“parent”: “urn:li:share:7361xxxxx”,“root”: “urn:li:share:7361xxxxx”},“visibility”: {“com.linkedin.ugc.MemberNetworkVisibility”: “PUBLIC”},“lifecycleState”: “PUBLISHED”}
    

    replace "urn:li:share:7361xxxxx" with the actual urn:li:share: number when you actually create the post, can you get the urn:li:share, you cant repost without this,

You can do the same think on company, the company URN is usually the ID, in the URL displayed on company page URL, same process replace the credentials, to use the correct one and the body the replace the line, you have to use the correct organization number.

“author”: “urn:li:organization:10440005”,

It took me a long time and research to figure this out, hope this helps some one trying to repost on lInked in.

We generate posts and want to repost on other linked in pages, if we post the same content linked in may consider it as spam, hence we wanted to use repost feature.