connection_type:
A member profile cannot list comments: LinkedIn grants read access to a member’s comments only to apps it selects, and SocialAPI’s app does not have that access. A company Page account replies, likes, and deletes as the Page, and a member profile as the member. A reply, or a top-level comment on a post, costs 1 interaction credit. Listing, liking, and deleting cost no credits.
Endpoints
{post_id} is the LinkedIn post URN, for example urn:li:share:7251234567890123456. It is targets[].platform_post_id on a post you published through SocialAPI, or id in GET /v1/inbox/comments. Put the URN in the path as it is, not URL-encoded, and put a comment URN in the path the same way. {comment_id} and comment_id accept the comment’s sapi_cmt_ ID or its LinkedIn comment URN: see Comment IDs.
List the comments on a company Page post
GET /v1/inbox/comments/{post_id} lists the top-level comments on a post of a company Page. account_id is required.
The 3 filter parameters
moderation_status, order, and q have no effect on LinkedIn. A post with no comments, and a post ID LinkedIn does not know, both return an empty data array, not 404. The comment and reply lists can show a change up to 5 minutes late, whether the change was made on LinkedIn or through SocialAPI: a new comment or reply, a deletion, or a like.
Pagination
Passnext_cursor back as cursor until has_more is false. Treat the cursor as an opaque string. limit is 25 comments or 10 replies by default, up to 100. A value above 100 is treated as 100: see Pagination.
Replies
GET /v1/inbox/comments/{post_id}/{comment_id}/replies lists the replies to one comment, in the same shape. LinkedIn nests comments 1 level deep: a top-level comment has replies, and a reply has no replies of its own.
Posts with comments
GET /v1/inbox/comments?account_id={account_id} returns the account’s posts with comment_count. On a company Page, the list holds the Page’s posts, including posts made outside SocialAPI. On a member profile, the list holds only the posts published through SocialAPI, and comment_count counts the replies and top-level comments posted through SocialAPI, and does not go down when one is deleted. On LinkedIn posts, thumbnail is null and like_count is 0. permalink is the post’s LinkedIn URL for a post published through SocialAPI, and null for a post made on LinkedIn. The parameters are in List posts with comments.
Reply to a comment
POST /v1/inbox/comments/{post_id} posts a public reply as the company Page or as the member. Both connection types can reply.
comment_id in the response is the new reply’s sapi_cmt_ ID. Use it to like or delete the reply later.
- Reply to the top-level comment. LinkedIn nests comments 1 level deep. To answer a reply, set
comment_idto the top-level comment that holds it. - Text only. A reply carries no image, and SocialAPI has no endpoint to edit a reply once posted.
- No mentions. The
@[Name](urn:li:person:...)mention syntax of LinkedIn publishing does not apply to replies: SocialAPI sends the reply text to LinkedIn exactly as you wrote it. - Cost. A reply, or a top-level comment on a post, costs 1 interaction credit. When the plan’s interaction allowance is used up, the call returns
429 validation.interaction_limit_exhausted. A reply that fails with avalidation.*error gives the credit back: see When a credit comes back. - LinkedIn’s rate limit. LinkedIn limits how many comments one member creates per minute. Past it, the call returns
429 platform.linkedin.rate_limit.
Like and delete a comment
POST /v1/inbox/comments/{post_id}/{comment_id}/like likes a comment as the connected account, and DELETE on the same path removes the like. DELETE /v1/inbox/comments/{post_id}/{comment_id} deletes the comment on LinkedIn and cannot be undone. Each returns { "success": true }. account_id goes in the body for the POST, and in the query for both DELETE calls.
can_delete is true on every LinkedIn comment, and LinkedIn decides which comments the account can delete. When LinkedIn refuses, the call returns 403 platform.linkedin.access_denied, and retrying does not help. A comment ID that does not start with sapi_ and is not a LinkedIn comment URN returns 400 validation.comment_urn on delete. Liking, unliking, and deleting cost no credits.
Comment IDs
A LinkedIn comment has 2 IDs, and every endpoint above accepts both:id, thesapi_cmt_ID SocialAPI returns in lists and in the reply response.platform_id, LinkedIn’s comment URN:urn:li:comment:(urn:li:activity:{activity ID},{comment ID}).
comment_id of each reply it posted, and comment URNs taken from LinkedIn. A URN you build yourself must use the urn:li:activity: form. On a reply or a like, LinkedIn refuses a comment URN built on a urn:li:share: ID, and the call returns 400 validation.field_required with meta.field set to request_body. ID rules for every platform are in IDs.
What LinkedIn does not allow
- Hide and unhide. LinkedIn has no hidden comments.
POSTandDELETEon/v1/inbox/comments/{post_id}/{comment_id}/hidereturn501 resource.not_supported. Delete the comment instead. - Private replies. LinkedIn has no private reply to a commenter.
POST /v1/inbox/comments/{post_id}/{comment_id}/private-replyreturns501 resource.not_supported, or400 validation.field_not_supportedwhen the request carriesattachment. LinkedIn direct messages are not available either. - Reading comments as a member profile. On a member profile, listing comments or replies returns
501 resource.not_supported. Connect the company Page to read the comments on its posts. - Comment events. SocialAPI sends no
comment.receivedevent for LinkedIn. List the comments on a company Page post to find new ones. Comments that mention the company Page come through Mentions and themention.receivedevent: see the Mentions row in LinkedIn capabilities.
Errors and debugging
Check these in order when a LinkedIn comment call fails. The shared checks are in Comments, and every code is in Errors.501 resource.not_supported. The call lists comments or replies on a member profile, hides, unhides, or sends a private reply. Connect the company Page to list its comments, and delete a comment instead of hiding it. Hiding or unhiding on an account withoutcomments.writereturns403 account.permission_missinginstead.401 platform.linkedin.auth. LinkedIn rejected the token, and the account is nowtoken_expired. Reconnect it: see LinkedIn.401 platform.linkedin.unauthorizedleaves the account usable: retry, and reconnect if it persists.403 platform.linkedin.access_denied. LinkedIn refused the action for this account, for example a delete it does not allow. Reconnecting does not change it. Readmessage.404 account.not_foundon an account you hold. LinkedIn refused the action without naming a reason. On a company Page, check that the member who connected it still administers it. Then reconnect the account.400 validation.comment_urn,400 validation.id_invalid. On a delete, a comment ID that does not start withsapi_and is not a LinkedIn comment URN returnsvalidation.comment_urn. On any call, a malformedsapi_ID returnsvalidation.id_invalid. Send thesapi_cmt_ID or theplatform_idfrom a list.400 validation.field_requiredwithmeta.fieldset torequest_body. LinkedIn rejected the request as malformed, for example a reply or a like on a comment URN built on aurn:li:share:ID. Use theurn:li:activity:form: see Comment IDs.404 resource.not_found. LinkedIn does not know the comment or the post on a reply, like, or delete, for example because it was deleted on LinkedIn.429 platform.linkedin.rate_limit. LinkedIn’s rate limit, or LinkedIn being temporarily unavailable. Back off and retry.platform.linkedin.api_error. LinkedIn returned an error that has no specific code. When LinkedIn gives a reason,error.messagecarries it. Retry later, and stop if it repeats.
Permissions and scopes
Each operation needs an account permission on the connected account. The LinkedIn scopes behind each permission are in LinkedIn scopes.
On a company Page, listing comments or replies without
comments.read returns 403 account.permission_missing. On either connection type, replying, liking, unliking, deleting, hiding, or unhiding without comments.write returns 403 account.permission_missing. error.meta.permission names the permission. On a member profile, listing returns 501 resource.not_supported whatever its permissions. GET /v1/inbox/comments never returns account.permission_missing. A key without the scope returns 403 auth.insufficient_scope: see Scoped API keys.
Use from an AI agent
The tool list is in MCP tools.
Related
- LinkedIn API: capabilities, connect rules, mentions, insights, and scopes for LinkedIn
- LinkedIn publishing: publish the posts these comments arrive on
- Comments: the endpoints, fields, and rules shared by every platform
- IDs: the
sapi_cmt_ID and the platform IDs these endpoints accept - Plans and usage: what costs an interaction credit