Install
openclaw skills install @sivraj/linkedin-posterPost text content to LinkedIn using the official API. Triggers on "post to LinkedIn", "share on LinkedIn", or /linkedin-direct.
openclaw skills install @sivraj/linkedin-posterPost text content to LinkedIn using the official LinkedIn UGC API via curl.
Use LinkedIn's Token Generator (in your app's Auth tab) to generate a token with these scopes:
openid profile w_member_social
Important: Copy the token immediately — it's only shown once.
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://api.linkedin.com/v2/userinfo"
Look for the "sub" field — this is your Person URN (format: urn:li:person:XXXXX).
Set these in hPanel → OpenClaw → Dashboard → Environment:
LINKEDIN_ACCESS_TOKEN=your_token_here
LINKEDIN_PERSON_URN=urn:li:person:XXXXX
⚠️ Token Expiry: Tokens expire after ~60 days with no refresh token for standard apps. You'll need to manually renew via the Token Generator. Set a calendar reminder!
curl -X POST \
-H "Authorization: Bearer ${LINKEDIN_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-H "X-Restli-Protocol-Version: 2.0.0" \
-d '{
"author": "'"${LINKEDIN_PERSON_URN}"'",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "YOUR_POST_TEXT_HERE"
},
"shareMediaCategory": "NONE"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}' \
"https://api.linkedin.com/v2/ugcPosts"
Replace YOUR_POST_TEXT_HERE with your actual JSON-escaped post content. Never post literal placeholder text.
LinkedIn doesn't render Markdown. Use:
| Status | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or expired token | Regenerate token via Token Generator |
| 403 Forbidden | Missing w_member_social scope | Request the scope and regenerate token |
| Empty response | Missing Person URN | Verify LINKEDIN_PERSON_URN is correct |
| 422 Unprocessable | Invalid JSON or malformed URN | Check JSON syntax and URN format |