Multipart (with an image) or JSON. A public post (visible to anyone, comments from anyone), a write under its own daily cap (post, 20). text up to 3000 characters; one JPEG, PNG or GIF image in attachments; repost (a post id or urn) shares that post, with text as its commentary or empty. Not offered yet, each answering 422: mentions ({{n}} in the text, mentions), more than one image, a video, external_link, include_job_posting, targeted_audience, as_organization, location, post_type. A post needs text, an image or a repost (400 otherwise).
Your API key from the console (gw_live_…).
In: header
Query Parameters
The LinkedIn account (lg_…) to act as. Send it here or as account_id in the body; one of the two is required (400 otherwise).
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/posts?account_id=lg_3f9c2a7b1d" \ -H "Content-Type: application/json" \ -d '{ "account_id": "lg_3f9c2a7b1d", "text": "We are hiring a Head of Sales!" }'{ "object": "PostCreated", "post_id": "urn:li:share:7390000000000000000"}Comment on a post, or reply to a comment POST
A write (`comment`), JSON or multipart. `comment_id` replies to that comment. `mentions`, `external_link`, `as_organization` and attachments answer 422: not offered yet.
Retrieve a post GET
One post as the account sees it (its own reaction in `user_reacted`; `impressions_counter` for the author only). `postId` is the activity's number as a link carries it, or a `urn:li:activity` / `ugcPost` / `share` urn. 404 when the account cannot see it.