JavaScript SDK: swarmhit.campaigns.leads.stop(campaignId, leadId)
Terminally stops the lead's sequence (status becomes stopped) so the
executor never contacts it again. The lead stays in the campaign with
its history intact; use DELETE /campaigns/{id}/leads/{leadId} to remove
it entirely. Not resumable. No-op on a lead that is already done, failed
or replied.
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
The lead's id.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/campaigns/string/leads/string/stop"{ "data": { "campaignId": "string", "leadId": "string", "senderId": "string", "linkedinAccountId": "string", "emailAccountId": "string", "emailProvider": "google", "whatsappAccountId": "string", "status": "pending", "stage": "pending", "firstName": "string", "lastName": "string", "headline": "string", "company": "string", "picture": "string", "profileUrl": "string", "publicIdentifier": "string", "email": "string", "openProfile": true, "customVariables": { "property1": "string", "property2": "string" }, "label": "interested", "labelBy": "manual", "labelAt": "2019-08-24T14:15:22Z", "interest": "interested", "interestBy": "manual", "currentStepId": "string", "waitUntil": "2019-08-24T14:15:22Z", "waitReason": "company_limit", "pausedReason": "user", "heldBy": { "campaignId": "string", "campaignName": "string", "senderName": "string" }, "invitationSentAt": "2019-08-24T14:15:22Z", "invitationAccepted": true, "invitationAcceptedAt": "2019-08-24T14:15:22Z", "invitationWithdrawnAt": "2019-08-24T14:15:22Z", "invitationSentWithoutNote": true, "messageSentAt": "2019-08-24T14:15:22Z", "lastReplyAt": "2019-08-24T14:15:22Z", "emailOpenedAt": "2019-08-24T14:15:22Z", "emailClickedAt": "2019-08-24T14:15:22Z", "finishedAt": "2019-08-24T14:15:22Z", "error": "string", "createdAt": "2019-08-24T14:15:22Z" }}Set a lead's label in a campaign PATCH
**JavaScript SDK:** [`swarmhit.campaigns.leads.setInterest(campaignId, leadId, params)`](/smart-api/sdk/methods#campaigns.leads) Sets the lead's `label` in this campaign, or clears it with `null`. A label set here is never changed by AI; with none, AI labels the lead's next reply (when the campaign has `aiInterestEnabled`). `interest` still works as before labels: `interested` or `not_interested`, and `null` clears the label. Pass one of the two. Only the label is editable here. Update lead fields and `customVariables` via `PATCH /leads/{id}` — they're shared across every campaign the lead is in.
Add leads to a list POST
**JavaScript SDK:** [`swarmhit.lists.leads.add(listId, params)`](/smart-api/sdk/methods#lists.leads) Upserts the workspace leads from the `{ profileUrl, ... }` objects you pass and attaches them to this list in one call — you don't need to create leads separately first. Existing leads are matched on their LinkedIn identifier and updated with any new fields. With the email channel, an item with only an `email` is matched on that address instead, and with the WhatsApp channel one with only a `phone` on that number (see `LeadInput`). Max 1000 leads per request. If the list is a campaign's own list (the campaign's `listId`), the leads are also enrolled in that campaign, subject to its exclusion rules; leads already in the campaign are skipped. `enrolled` in the response is how many were enrolled (0 for any other list).