JavaScript SDK: swarmhit.campaigns.list(params?)
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Query Parameters
Page size, 1–100.
1 <= value <= 10050Number of records to skip.
0 <= value0Response Body
application/json
application/json
curl -X GET "https://example.com/campaigns"{ "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" } ], "paging": { "limit": 0, "offset": 0 }}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).
Rebalance a sender's leads POST
**JavaScript SDK:** [`swarmhit.campaigns.rebalanceSender(campaignId, accountId)`](/smart-api/sdk/methods#campaigns) Move a paused or failed sender's not-yet-contacted leads in this campaign onto the campaign's other available senders, evenly. Leads the sender already contacted stay pinned to it. Returns how many leads `moved` and how many `receivers` took them; `receivers: 0` means no other sender was available and nothing moved (still `200`). `422` when the account is not in the campaign's sender pool.