JavaScript SDK: swarmhit.campaigns.duplicate(campaignId)
Clones the campaign's blueprint — name (suffixed " (copy)"), outreach
sequence, send schedule, sender pool (linkedinAccountIds), mailbox
pool (emailAccountIds), the lead-exclusion rules and the email and AI
settings (unsubscribe, tracking, aiInterestEnabled) — into a fresh
campaign that starts paused with no leads and zeroed stats. Use it to rework a sequence that's locked
because leads are already in progress, or to spin up a variant of a
working campaign.
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/campaigns/string/duplicate"{ "data": { "id": "string", "name": "string", "status": "draft", "stats": { "total": 0, "done": 0, "failed": 0 }, "aiInterestEnabled": true, "unsubscribe": { "enabled": true, "text": "string" }, "tracking": { "opens": "mailbox", "clicks": "mailbox" }, "linkedinAccountIds": [ "string" ], "emailAccountIds": [ "string" ], "whatsappAccountIds": [ "string" ], "senderIds": [ "string" ], "excludeListIds": [ "string" ], "listId": "string", "excludeOtherCampaigns": true, "excludeOtherSenders": true, "excludeSameSenderOtherCampaigns": true, "companyLimit": { "max": 1, "period": "day", "scope": "campaign" }, "pauseCompanyOnReply": true, "outOfOffice": { "enabled": true, "fallbackDays": 7 }, "matchEmailProvider": true, "schedule": { "startDate": "2019-08-24T14:15:22Z", "endDate": "2019-08-24T14:15:22Z", "timezone": "string", "activeHours": { "from": "string", "to": "string" }, "activeDays": [ 0 ] }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "sequence": { "steps": [ { "id": "string", "type": "if_connected", "parent": "string", "branch": "yes", "config": {}, "nextDelayHours": 0, "branchDelays": { "yes": 0, "no": 0 } } ] } }}Delete a campaign DELETE
**JavaScript SDK:** [`swarmhit.campaigns.delete(campaignId)`](/smart-api/sdk/methods#campaigns) Permanently deletes the campaign and removes every lead's membership in it. This cannot be undone.
Get a campaign GET
**JavaScript SDK:** [`swarmhit.campaigns.get(campaignId)`](/smart-api/sdk/methods#campaigns) Returns the campaign including its outreach `sequence` (the tree of steps).