Publishing Member Content via the LinkedIn UGC API
Learn how to use the LinkedIn UGC API to programmatically create member shares, including required URN formats, OAuth scopes, and rate limit handling.
09 Oct 2026, 22:33 UTC

Automating Member Shares with the UGC API
To programmatically publish a post to a LinkedIn member's feed, you must use the User Generated Content (UGC) API. The primary requirement is an OAuth 2.0 access token granted with the w_member_social scope, which allows your application to act on behalf of the user to create shares.
The core takeaway for developers is that the UGC API is not a simple "text-to-post" endpoint; it requires a specific URN (Uniform Resource Name) for the author and a defined lifecycleState to make the content visible to the network.
The Mechanism of a UGC Post
A UGC post consists of three main components: the author's identity, the visibility settings (who can see the post), and the specific content (text, links, or media). The API uses the Restli protocol, which requires a specific header to ensure the request is processed correctly.
Implementation Example
The following example demonstrates how to publish a basic text-based share. This request should be executed from your application server to avoid exposing your access token in client-side code.
# Run this command from a terminal with curl installed
# Required Permissions: Valid OAuth 2.0 Access Token with w_member_social scope
curl -X POST 'https://api.linkedin.com/v2/ugcPosts' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'X-Restli-Protocol-Version: 2.0.0' \
-H 'Content-Type: application/json' \
-d '{
"author": "urn:li:person:ABC123XYZ",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Automating my professional updates via the UGC API!"
},
"shareMediaCategory": "NONE"
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}'
Configuration Breakdown
- author: Must follow the format
urn:li:person:{member_id}. Using a plain ID without the URN prefix will result in a request failure. - lifecycleState: Set to
PUBLISHED. If omitted or set incorrectly, the post may not appear in the feed. - shareMediaCategory: Set to
NONEfor text-only posts. If you are attaching an image or video, this must be changed toIMAGEorVIDEO, and the media must be pre-registered via the LinkedIn upload API. - visibility: Accepts
PUBLIC(anyone on or off LinkedIn) orCONNECTIONS(only the member's first-degree connections).
Constraints and Technical Limits
When designing your integration, account for the following hard limits to avoid application crashes or API bans:
| Constraint | Limit/Requirement |
|---|---|
| Text Length | Maximum 1,300 characters per post. |
| Media Size | Images must be ≤ 5 MB. |
| Rate Limits | Approximately 100 shares per token per day (varies by app tier). |
| Immutability | Posts created via UGC API cannot be deleted via the API. |
Common Integration Pitfalls
Scope Rejection: Many developers encounter an invalid_scope error during OAuth. The w_member_social scope is restricted; it is typically only granted to applications with a verified business email and an approved use case. Ensure your developer app is fully verified before requesting this scope.
Handling Rate Limits: When the daily quota is exceeded, LinkedIn returns a 429 Too Many Requests response. Your application must check for the Retry-After header in the response to determine when it is safe to attempt the next post.
Media Workflow: A common mistake is attempting to send a raw image URL in the ugcPosts request. LinkedIn requires a two-step process: first, register the upload and upload the binary file to a temporary LinkedIn URI; second, reference that URI in the ugcPosts call.
Verification and Testing
To verify the implementation, execute the POST request and check for a 201 Created status code. The response body will contain an activity URN (e.g., urn:li:activity:12345). To confirm the result, log into the member account associated with the token and verify the post appears on the profile's activity feed.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.