Facebook Pixel

Reply to Comment

Reply to a comment on a LinkedIn post

POST/linkedin/reply

Reply to Comment

Reply to a comment on a LinkedIn post

Authentication requiredLinkedIn Posts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/reply' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"commentId":"urn:li:fsd_comment:(7406438480937074688,urn:li:activity:7406311301075054592)","reply":"Thank you for your comment!"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID (uses default if not provided)
commentIdstringYesComment URN to reply to. Supports two formats:
- urn:li:fsd_comment:(commentNumber,urn:li:activity:activityId)
- urn:li:comment:(activity:activityId,commentNumber)
replystringYesReply text content
postUrlstringNoOptional post URL for better browser simulation (recommended)
companyUrnstringNoOptional company URN if replying as a company page

Example

{
  "commentId": "urn:li:fsd_comment:(7406438480937074688,urn:li:activity:7406311301075054592)",
  "reply": "Thank you for your comment!",
  "postUrl": "https://www.linkedin.com/posts/john-doe-123_..."
}

Responses

StatusDescription
200Successfully replied to comment
400Invalid request (e.g., invalid commentId format)
401Unauthorized
500Server error

200 Example

{
  "success": true,
  "message": "Successfully replied to comment",
  "commentId": "urn:li:comment:(activity:7406311301075054592,7406438480937074688)",
  "originalCommentId": "urn:li:fsd_comment:(7406438480937074688,urn:li:activity:7406311301075054592)",
  "reply": "Thank you for your comment!",
  "accountId": "507f1f77bcf86cd799439011"
}

Comment ID Formats

The API accepts comment IDs in two formats and automatically transforms them:

  1. FSD Comment Format (from LinkedIn API responses):

    urn:li:fsd_comment:(7406438480937074688,urn:li:activity:7406311301075054592)
  2. Comment Format (required by LinkedIn API):

    urn:li:comment:(activity:7406311301075054592,7406438480937074688)

The API automatically transforms the FSD format to the required format internally.

Notes

  • The endpoint automatically transforms comment URN formats if needed
  • If postUrl is not provided, a generic LinkedIn referer is used
  • Replies support company pages via the companyUrn parameter
  • The API includes human-like delays to simulate natural behavior
  • Comment IDs can be obtained from the Get Post Comments endpoint