API referenceLinkedin posts
POST
/api/v1/posts/{postId}/comments

A write (comment), JSON or multipart. comment_id replies to that comment. mentions, external_link, as_organization and attachments answer 422: not offered yet.

Authorization

X-API-KEY<token>

Your API key from the console (gw_live_…).

In: header

Path Parameters

postId*string

The post's social_id (urn:li:activity:… or urn:li:ugcPost:…), as a post read gives it.

Query Parameters

account_id?string

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).

Request Body

application/json

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/urn:li:activity:7390000000000000000/comments?account_id=lg_3f9c2a7b1d" \  -H "Content-Type: application/json" \  -d '{    "account_id": "lg_3f9c2a7b1d",    "text": "Congratulations on the launch!"  }'
{  "object": "CommentSent",  "id": "urn:li:comment:(activity:7390000000000000000,7390000000000000123)",  "comment_id": "urn:li:comment:(activity:7390000000000000000,7390000000000000123)"}