st.commentOnPost

This action allows you to leave a comment on a post.

Constraints

⏺️ Root Start: allowed, when postUrl or postUrn parameter is provided.

⬆️ Parent Actions: st.openPost, st.doForPosts.

⬇️ Child Actions: N/A.

Parameters

json
{
  "actionType": "st.commentOnPost",
  "label": "post1",
  "postUrl": "https://www.linkedin.com/posts/post1",
  "companyUrl": "https://www.linkedin.com/company/company1",
  "text": "I completely agree with your point."
}
  • label (optional) – custom label for tracking this action in workflow completion.
  • postUrl (required for root start unless postUrn is provided, forbidden for parent start) – LinkedIn URL of the post.
  • postUrn (optional) – URN of the post, accepted instead of postUrl. When both are provided, the URL must contain that same URN.
  • text – comment text, must be up to 1000 characters.
  • companyUrl (optional) – LinkedIn company page URL. When provided, the comment will be posted on behalf of the company. Requires content admin access to the company page.

Result options

  1. Successful post commenting:
json
{
  "actionType": "st.commentOnPost",
  "label": "post1",
  "success": true,
  "data": {
    "commentUrn": "urn:li:comment:(urn:li:activity:1234567890123456789,9876543210)",
    "commentUrl": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789/?dashCommentUrn=urn%3Ali%3Afsd_comment%3A(9876543210%2Curn%3Ali%3Aactivity%3A1234567890123456789)"
  }
}
  • label – included only if specified in the action parameters.
  • data – information about the created comment.
    • commentUrn – LinkedIn URN of the created comment, if available.
    • commentUrl – canonical deep-link URL of the created comment, if available. It can be used as the commentUrl input for st.openComment, st.reactToComment, or st.replyToComment.
  1. Failed post commenting:
json
{
  "actionType": "st.commentOnPost",
  "label": "post1",
  "success": false,
  "error": {
    "type": "commentingNotAllowed",
    "message": "Commenting is not allowed on this post."
  }
}
  • label – included only if specified in the action parameters.
  • error.type – enum with the following possible values:
    • postNotFound – provided URL is not an existing LinkedIn post.
    • duplicateComment – this account already published the same text on this post through Linked API within the last 24 hours, so it was not published again. Text is compared after trimming and collapsing whitespace, and a comment published as a company page is counted separately from a personal one. The message links the earlier comment when it is known.
    • commentingNotAllowed – commenting is not allowed on this post. This could be due to the post author's privacy settings, LinkedIn restrictions on commenting, or because the post type does not support comments.
    • noPostingPermission – no permission to comment on behalf of this company.