JavaScript SDK: swarmhit.lists.create(params?)
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/lists" \ -H "Content-Type: application/json" \ -d '{ "name": "Conference leads" }'{ "data": { "id": "string", "name": "string", "color": "string", "leadCount": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}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).
Delete a lead list DELETE
**JavaScript SDK:** [`swarmhit.lists.delete(listId)`](/smart-api/sdk/methods#lists) Deletes the list. The leads in it are kept; only their membership is removed.