Reply to Comment
Reply to a comment on a LinkedIn post
POST
/linkedin/replyReply 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
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID (uses default if not provided) |
commentId | string | Yes | Comment URN to reply to. Supports two formats: - urn:li:fsd_comment:(commentNumber,urn:li:activity:activityId)- urn:li:comment:(activity:activityId,commentNumber) |
reply | string | Yes | Reply text content |
postUrl | string | No | Optional post URL for better browser simulation (recommended) |
companyUrn | string | No | Optional 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
| Status | Description |
|---|---|
| 200 | Successfully replied to comment |
| 400 | Invalid request (e.g., invalid commentId format) |
| 401 | Unauthorized |
| 500 | Server 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:
-
FSD Comment Format (from LinkedIn API responses):
urn:li:fsd_comment:(7406438480937074688,urn:li:activity:7406311301075054592) -
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
postUrlis not provided, a generic LinkedIn referer is used - Replies support company pages via the
companyUrnparameter - The API includes human-like delays to simulate natural behavior
- Comment IDs can be obtained from the Get Post Comments endpoint
