APILinkedIn Posts
Reply to a comment
Post a reply to an existing comment on a LinkedIn post. Replies appear threaded under the original comment. Optionally tag a member with a real @mention that notifies them (e.g. the original commenter) by passing `mention`. Useful for continuing conversations and engaging with community discussions.
POST
/replyAuthentication requiredPosts
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/reply' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"commentId":"12345","reply":"Thanks for the thoughtful comment, {{user}} — totally agree!","mention":{"name":"Jane Smith","profileUrn":"urn:li:fsd_profile:ACoAABcdefgh"}}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
commentId | string | Yes | ID of the comment to reply to (from /posts/comments response) |
reply | string | Yes | Reply text content. Supports hashtags. When mention is provided, place a {{user}} placeholder where the tag should appear — otherwise the tagged member's name is prepended. |
mention | object | No | Optional @mention to tag a member in the reply. Produces a real LinkedIn tag that notifies the member (e.g. tag the original commenter). The visible tag replaces the {{user}} placeholder in reply (or is prepended if no placeholder is present). |
Example
{
"commentId": "12345",
"reply": "Thanks for the thoughtful comment, {{user}} — totally agree!",
"mention": {
"name": "Jane Smith",
"profileUrn": "urn:li:fsd_profile:ACoAABcdefgh"
}
}Responses
| Status | Description |
|---|---|
| 200 | Reply posted successfully |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
replyId | string |
200 Example
{
"success": true,
"replyId": "12345"
}Create a LinkedIn post
Creates a LinkedIn post. For text-only, omit mediaType. For media posts, first use /posts/upload/init to upload, then pass the assetUrn here.
Like a comment
Like an existing comment on a LinkedIn post. Sends a pre-signal to LinkedIn before the actual like action for realistic engagement simulation.
