Comment on a LinkedIn post
Add a comment to a LinkedIn post. Comments increase engagement and visibility. Can optionally tag the post author for notification. Supports posting as a company page if you have admin access. Rate limit: 100 comments per day.
/posts/commentCode Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/posts/comment' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"postUrl":"https://linkedin.com/posts/example-post","comment":"example_value"}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
postUrl | string | Yes | Full URL of the LinkedIn post to comment on |
comment | string | Yes | Comment text content. Supports @mentions and hashtags. |
tagPostAuthor | boolean | No | Whether to @mention the post author in the comment |
companyUrn | string | No | Company URN to post comment as company page instead of personal profile |
Example
{
"postUrl": "https://linkedin.com/posts/example-post",
"comment": "example_value"
}Responses
| Status | Description |
|---|---|
| 200 | Comment posted successfully |
| 400 | Bad request - Missing required fields or validation error |
| 401 | Unauthorized - Invalid or missing API key |
| 429 | Rate limit exceeded |
| 500 | Server error - Failed to post comment |
Rate Limit Headers
All responses include rate limit information in the headers:
| Header | Description |
|---|---|
X-RateLimit-Action | The action type being rate limited |
X-RateLimit-Limit | Maximum actions allowed per period |
X-RateLimit-Used | Actions used in current period |
X-RateLimit-Remaining | Actions remaining |
X-RateLimit-Reset | ISO 8601 timestamp when limit resets |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
message | string | Success message |
postUrl | string | URL of the post that was commented on |
comment | string | The comment text that was posted |
accountId | string | LinkedIn account ID that posted the comment |
postDetails | object | Details about the post that was commented on |
200 Example
{
"success": true,
"message": "Successfully posted comment",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7430667226199830528/",
"comment": "Great insights! Thanks for sharing.",
"accountId": "696ce9e780e0483585e4e553",
"postDetails": {
"activityUrn": "urn:li:activity:7430667226199830528",
"ugcPostUrn": null,
"shareUrn": "urn:li:share:7430667225633550337",
"featuredActivityUrn": null,
"content": "Discover proven LinkedIn strategies for consultants to attract high-value clients..."
}
}400 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
400 Example
{
"error": "postUrl is required",
"success": false
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "Unauthorized"
}429 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string | |
success | boolean |
429 Example
{
"error": "Rate limit exceeded for COMMENT: 100/100 used. Resets at 2024-01-16T00:00:00.000Z",
"success": false
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "Failed to post comment",
"success": false
}Get latest posts from a profile
Retrieve the most recent posts from a LinkedIn profile. Useful for monitoring competitor content, tracking influencer activity, or finding engagement opportunities. Can include or exclude reposts/shares.
React to a LinkedIn post
Add a reaction to a LinkedIn post. LinkedIn supports 6 reaction types beyond simple likes. Reactions are a lightweight way to engage with content and increase visibility in your network. Supports reacting as a company page if you have admin access.
