1. Overview
LinkedIn posts publish as the connected member (linkedin).
2. Supported media
A post cannot mix a video with images. A
media_id video among 2 or more media items returns 400 publishing.validation_failed. A platform_attachment_id video among 2 or more items fails the target at publish time with 400 validation.media_type. A video sent by url among 2 or more items is refused by LinkedIn at upload.
File limits for media you upload to SocialAPI (source_type: "media_id"): images at most 10 MB. Videos at most 500 MB, 3 seconds to 30 minutes long, and at most 30 frames per second. Text holds at most 3,000 characters. SocialAPI checks these limits before it publishes, and a violation returns 400 publishing.validation_failed.
3. Create post
UsePOST /v1/posts with targets pointing at a LinkedIn account and publish_now: true. The text field becomes the post commentary. The platform comes from the account, so a target has no platform field.
Visibility
visibility sets who sees the post. Send it on the post, or on a target to override the post. When both set it, the target’s value wins.
Any other value fails validation on the field
visibility.
Text formatting
Writetext as plain text. Characters LinkedIn reserves for formatting (| { } @ [ ] ( ) < > # \ * _ ~) are escaped for you, so they appear on LinkedIn exactly as typed. Text you already escaped with a backslash (for example \() is published unchanged.
A
# inside a word (C#, page#section) and an @ outside the mention syntax (an email address) are published as plain text.
Link post with a call to action
Setarticle_url to publish a link post. Add cta_label and cta_url for a call-to-action button. An attached image becomes the link thumbnail. LinkedIn builds no preview of its own, so set article_title and article_description too.
Platform data fields
Send these keys inplatform_data.linkedin on the post, which applies them to every LinkedIn target. To set them for one target, send them flat in that target’s platform_data (targets[].platform_data, with no linkedin key). When both set the same key, the target’s value wins.
SocialAPI forwards any additional keys in
platform_data.linkedin that the table above lists, and no others. LinkedIn has no other publish options that SocialAPI passes through: an unlisted key is ignored without a warning. A malformed article_url, a cta_label outside the list, or a cta_label or cta_url without article_url fails validation on that field.
Scheduling
Setscheduled_at to an ISO 8601 timestamp (UTC) instead of publish_now. SocialAPI holds the post and publishes it at that time.
4. Update post
LinkedIn posts cannot be edited through SocialAPI once they are published.PATCH /v1/posts/{pid} edits only a post in draft, scheduled, or failed status, and returns 409 post.state_invalid for a published post. To correct a published post, delete it and publish a new one.
5. Delete post
DELETE /v1/posts/{pid} deletes the post from LinkedIn when its LinkedIn target is published. A target that is not published is removed from SocialAPI only. See Delete a post.
6. Retrieve posts
GET /v1/posts?platform=linkedin&account_ids={id} lists posts.
The list holds the posts you published through SocialAPI. LinkedIn gives apps no read of a member’s own posts, so a post published on LinkedIn directly never appears. A LinkedIn post has no metrics.
7. Quirks, errors, and recovery
The post ID is returned for you
SocialAPI returns the LinkedIn post ID asplatform_post_id in the post body and in post.published events, with a permalink. You do nothing to retrieve it.
Video processing
LinkedIn processes a video after upload. A video LinkedIn cannot process fails the target with422 platform.linkedin.processing_failed. An upload or processing step that does not finish in time fails it with 504 platform.linkedin.upload_timeout or 504 platform.linkedin.processing_timeout. Upload a smaller or re-encoded file, then retry.
Link posts need their own preview
LinkedIn builds no preview for a link post. Setarticle_title, article_description, and attach an image. A video, or more than one media item, on a link post is ignored apart from the first image, and validation returns a warning on the field media.
Errors on a failed target
A publish that fails after the request returned puts a structured error on the target, intargets[].error, with its code. Every code is in Errors.
401 platform.linkedin.auth: the access token expired or was revoked. LinkedIn tokens last 60 days and cannot be refreshed. The account is markedtoken_expired, and every later call that acts on the account returns403 account.reconnection_requireduntil you reconnect it.403 platform.linkedin.access_denied: LinkedIn refused the action for this account. Reconnecting does not change it. Readmessage.429 platform.linkedin.rate_limit: LinkedIn’s own limit. Wait, then retry.
Recovery
- Rate limit. Wait for the seconds in
Retry-After, or at least 60 seconds when it is absent, then sendPOST /v1/posts/{pid}/retry. See Delivery. - Auth error. Reconnect the LinkedIn account through the OAuth flow.
- Media failure. Replace the file, create the post again, or edit the failed post and retry it.
8. Full worked example
This example publishes an image post with a mention and a hashtag, then reads the result. Step 1: Upload mediaupload_url, then call POST /v1/media/{media_id}/verify. The steps and the response are in Media. The result is a media_id, here f47ac10b-58cc-4372-a567-0e02b2c3d479.
Step 2: Publish the post
status: "publishing", as in Create post.
Step 3: Check the status
9. Required OAuth scopes
SocialAPI’s LinkedIn app requests these scopes during the OAuth flow. You configure nothing. The full list is in LinkedIn scopes.
The scopes a scoped API key needs, the credit cost of a post, and the MCP tools that publish are on Publishing.