1. Overview
LinkedIn publishing uses the LinkedIn Marketing API REST v202603 against your connected organization page. SocialAPI handles media uploading internally: images and videos are transferred from your S3 media library to LinkedIn’s hosted media service before the post is created.| Field | Value |
|---|---|
| Platform slug | linkedin |
| Auth type | OAuth 2.0 (LinkedIn) |
| API | LinkedIn Marketing API (REST v202603) |
| Create post | Yes |
| Update post | Yes (commentary text only) |
| Delete post | Yes |
| Schedule | Yes (deferred publish via schedule_at) |
| First comment | No |
2. Supported media
| Content type | How to trigger | Notes |
|---|---|---|
| Text only | No media_ids | Plain text post; commentary maps to text |
| Single image | One image URL in media_ids | Uploaded via 3-step LinkedIn image upload flow |
| Single video | One video URL in media_ids (.mp4, etc.) | Uploaded via 5-step multipart LinkedIn video upload flow |
| Multi-image carousel | Two or more image URLs in media_ids | Up to 20 images; uses LinkedIn multiImage content block |
media_ids entries and their MIME type. SocialAPI probes the file type from the S3 URL response header before deciding whether to use the image or video upload path.
Commentary limit: LinkedIn does not publish a hard character limit in their API docs, but posts over 3000 characters are truncated in most feed views. Keep posts under 3000 characters for reliable display.
Multi-image carousels: Supported with up to 20 images. Mixed media carousels (images and videos together in one post) are not supported by LinkedIn. If you include a video URL alongside image URLs in media_ids, the upload will fail at the LinkedIn API level because all items are treated as images.
3. Create post
UsePOST /v1/posts with account_ids targeting a LinkedIn organization page. The text field becomes the commentary field in the LinkedIn post body.
Validated fields
LinkedIn does not support anyplatform_data keys. The connector uses standard PostDraft fields only.
| Field | Maps to | Notes |
|---|---|---|
text | commentary | Post caption or body text |
media_ids | content.media or content.multiImage | S3 URLs; uploaded by SocialAPI before posting |
schedule_at | Deferred publish | ISO 8601 UTC timestamp |
platform_data.linkedin directly to the underlying platform API. These fields are not validated by SocialAPI and may break if the platform changes its API. See LinkedIn Posts API reference for the full list of supported parameters.
Image post
Provide a single image URL inmedia_ids. SocialAPI uploads it to LinkedIn using the 3-step image upload flow (initialize, PUT binary, poll until AVAILABLE) before creating the post.
Video post
Provide a single video URL inmedia_ids. SocialAPI uses the LinkedIn 5-step multipart video upload flow (initialize with file size, upload each part with Range requests, finalize with ETags, poll until AVAILABLE). Video processing on LinkedIn can take up to 5 minutes; SocialAPI polls until the video is ready before creating the post.
Multi-image carousel
Provide two or more image URLs inmedia_ids. All items are uploaded as images. LinkedIn renders them as a swipeable multi-image card.
Scheduling
Setschedule_at to an ISO 8601 timestamp (UTC) to defer publishing:
4. Update post
PATCH /v1/posts/:pid is supported for LinkedIn posts but is restricted to updating the commentary (text) only. LinkedIn does not allow changing attached media after a post is published.
media_ids is included in the update request body, SocialAPI returns 501 Not Implemented. Remove media_ids from the request to update text only.
5. Delete post
DELETE /rest/posts/{encodedURN} on the LinkedIn API. The post URN is URL-encoded before use in the path (for example, urn:li:share:12345 becomes urn%3Ali%3Ashare%3A12345).
6. Retrieve posts
UseGET /v1/posts to list posts. Filter by platform or account:
targets array with per-platform status and engagement metrics:
GET /rest/posts) does not return engagement metrics in post list responses. All metric fields (likes, comments, shares, saves) are always 0 after sync. SocialAPI does not make separate per-post metrics calls during listing. If you need engagement data, retrieve it directly from the LinkedIn Analytics API.
7. Quirks, errors, and recovery
URN-based IDs
LinkedIn post IDs are URNs, not numeric IDs. Examples:urn:li:share:12345 for regular posts and urn:li:ugcPost:12345 for UGC posts. SocialAPI stores these URNs verbatim in platform_post_id. All API calls to LinkedIn that include a post ID URL-encode the URN using url.QueryEscape before inserting it into the path.
Versioned API headers
Every request to the LinkedIn REST API must include two headers:LinkedIn-Version: 202603(the API version SocialAPI targets)X-Restli-Protocol-Version: 2.0.0
400 or 404. You do not need to set these headers yourself; SocialAPI adds them automatically.
Update rejects media changes
PATCH /v1/posts/:pid with media_ids present returns 501 Not Implemented. This is a hard limitation of the LinkedIn API: once a post is published, its media cannot be swapped, added, or removed via the API. To change media, delete the post and republish.
No mixed media in carousels
LinkedIn’smultiImage content block only accepts images. Mixing a video URL with image URLs in media_ids will cause the video to be passed through the image upload path, which will likely fail with a processing error from LinkedIn. Always use a single media_id entry for videos.
Video processing timeout
LinkedIn video uploads use a 5-step process and can take several minutes to process. SocialAPI polls the video status for up to 5 minutes (polling every 2 seconds). If the video does not reachAVAILABLE within that window, the publish fails with a 504 Gateway Timeout and the post target is marked failed. Large video files or high-traffic periods can trigger this timeout.
Image processing timeout
SocialAPI polls the image status for up to 30 seconds (polling every 500 ms). If the image does not reachAVAILABLE, the publish fails with a 504 Gateway Timeout.
Error shapes
When a publish fails, the post target’serror field contains a structured error:
| Error code | Category | Caused by | Meaning |
|---|---|---|---|
platform.linkedin.api_error | platform | platform | LinkedIn API rejected the request. Check message for details. |
platform.linkedin.auth | auth | platform | Access token expired or revoked. Reconnect the account. |
platform.linkedin.processing_failed | platform | platform | LinkedIn media processing failed after upload. Re-upload the media and retry. |
Recovery
- API error: Inspect the
messagefield for the specific LinkedIn error. Common causes are malformed content, missing scopes, or an organization page that no longer exists. - Auth error: Disconnect and reconnect the LinkedIn account through the OAuth flow. LinkedIn access tokens are long-lived but can be revoked by the user or expired by LinkedIn.
- Processing failed: Delete the post, re-upload the media file via
POST /v1/media/upload, and create a new post. - Processing timeout: Usually caused by a very large video file. Compress the video, re-upload, and retry.
8. Full worked example
The following example uploads an image and publishes a LinkedIn organization page post. Step 1: Upload media9. Required OAuth scopes
The following LinkedIn OAuth scopes must be approved for your application:| Scope | Purpose |
|---|---|
r_organization_social | Read posts and social data for organization pages |
w_organization_social | Create, update, and delete posts on organization pages |
rw_organization_admin | List and manage organization page admin roles (required to enumerate connected pages) |
w_organization_social is missing, post creation and deletion will fail with a 403 Forbidden from the LinkedIn API. If rw_organization_admin is missing, account connection will fail because SocialAPI cannot enumerate the organization pages the user administers.