JavaScript SDK: swarmhit.accounts.posts.comment(accountId, params)
Comment on a LinkedIn post from this account with the exact text you provide, or reply to one of its comments. Pass exactly one of postUrl (that post) or profileUrl (the lead's most recent post). With a postUrl, commentId replies to that comment instead (find one with GET /accounts/{id}/post-comments); a comment's own link (LinkedIn's "Copy link to comment", with commentUrn=) as the postUrl replies to that comment too. Posts at once. Counts against the account's daily post-comment cap. Returns 422 when the lead has no recent post, and 422 with code: post_not_found when postUrl is not a post's link (checked before anything else) or this account can't see the post. A reply that can't be made (a comment we can't read, or one on another post) is a 400: it never becomes a comment on the post. A post given by its link isn't tied to a lead: no lead is created, and the action's profileUrl is the post's author when that is a person.
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Header Parameters
Unique key per action (e.g. a UUID). Reusing it replays the first response instead of sending again, so a retry can't double-send. Read only by the endpoints that list it. A key is scoped to the endpoint and the account (or chat) it acts on, and kept for 24 hours. Only a successful response is stored and replayed: a 4xx frees the key, while a 5xx keeps it (the action may have gone out; retry with a new key). So does a 400 passing on a LinkedIn, WhatsApp or mail provider failure (code provider-unreachable, provider-408 for the provider's own timeout, or provider- and a 5xx status such as provider-502), unless the request provably never reached the provider (its connection never opened): the action may have gone out. A retry with the same key then gets 409 idempotency_failed. The request body is not compared, so a reused key replays the first response even if the body differs.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/accounts/string/post-comments" \ -H "Content-Type: application/json" \ -d '{ "postUrl": "https://www.linkedin.com/posts/jane-doe_hiring-activity-7332661864792854528-hcGT", "text": "Congrats on the launch!" }'{ "data": { "id": "string", "accountId": "string", "type": "invitation", "status": "pending", "profileUrl": "string", "publicIdentifier": "string", "postUrl": "string", "replyTo": "string", "reactionType": "like", "leadId": "string", "note": "string", "error": "string", "sentAt": "2019-08-24T14:15:22Z", "acceptedAt": "2019-08-24T14:15:22Z", "withdrawnAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z" }}Check connection status GET
**JavaScript SDK:** [`swarmhit.accounts.connections.get(accountId, identifier)`](/smart-api/sdk/methods#accounts.connections) This sender's connection with a profile: status (not_connected / pending / connected), connection degree, whether it is an open profile, and whether the sender can message or invite them. A read; no profile view is registered and no cap is used. `pending` only reflects invitations this sender sent through direct actions: one sent by a campaign or from LinkedIn itself reads `not_connected`. Use the username in lower case: an identifier with capital letters or underscores is treated as LinkedIn's internal member id and refused with 400.
Follow a lead POST
**JavaScript SDK:** [`swarmhit.accounts.profiles.follow(accountId, params)`](/smart-api/sdk/methods#accounts.profiles) Follow a lead from this sender account — subscribe to their posts without sending a connection request. Counts against the sender's daily follow cap.