API referenceDirect actions
POST
/accounts/{id}/follows

JavaScript SDK: swarmhit.accounts.profiles.follow(accountId, params)

Follow a lead from this sender account — subscribe to their posts without sending a connection request. Counts against the sender's daily follow cap.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string

Header Parameters

Idempotency-Key?string

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.

Lengthlength <= 255

Request 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/follows" \  -H "Content-Type: application/json" \  -d '{    "profileUrl": "string"  }'
{  "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"  }}

Comment on a post POST

**JavaScript SDK:** [`swarmhit.accounts.posts.comment(accountId, params)`](/smart-api/sdk/methods#accounts.posts) 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.

Like a post POST

**JavaScript SDK:** [`swarmhit.accounts.posts.like(accountId, params)`](/smart-api/sdk/methods#accounts.posts) Like a LinkedIn post from this account, or leave another reaction on it. Pass exactly one of `postUrl` (that post) or `profileUrl` (the lead's most recent post). Counts against the account's daily post-like cap, whatever the reaction. 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 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.