API referenceLeads in campaigns
GET
/campaigns/{id}/leads/{leadId}

JavaScript SDK: swarmhit.campaigns.leads.get(campaignId, leadId)

Returns the lead's progress in this campaign, including its full step history.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string
leadId*string

The lead's id.

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/campaigns/string/leads/string"
{  "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",    "history": [      {}    ]  }}

Add leads to a campaign POST

**JavaScript SDK:** [`swarmhit.campaigns.leads.add(campaignId, params)`](/smart-api/sdk/methods#campaigns.leads) Adds leads from a `leads` array of `{ profileUrl, ... }` objects (or `{ email, ... }` when the workspace has the email channel, `{ phone, ... }` with the WhatsApp channel, see `LeadInput`), or imports a whole lead list with `listId`. The workspace lead is upserted from the fields you pass and enrolled in one call — you don't need to create leads separately first. Adding makes no LinkedIn call; at first contact, LinkedIn's `firstName`, `lastName`, `headline` and picture replace the values you sent (other fields are kept). Leads already in the campaign are skipped, and so are items with neither a valid `profileUrl` nor (with the email channel) a valid `email` nor (with the WhatsApp channel) a `phone` with its country code. Leads on the workspace blocklist are not enrolled, nor left on the campaign's own list, and count as `blocklisted`; leads an exclusion rule keeps out are not enrolled and count as `excluded`. Max 1000 leads per request. A `leads` array returns `{ inserted, excluded, blocklisted, listId }` (skipped items are not counted); a `listId` import returns `{ inserted, skipped, excluded, blocklisted, listId, listName }`, where `skipped` counts the list's leads already in the campaign. Every enrolled lead is also saved to the campaign's own list, created on the first enrollment and named "<campaign name>'s leads" (exposed as `listId` on the campaign). That list and the campaign stay in step: adding leads to it enrolls them, removing leads from it removes them from the campaign. Leads imported with `listId` keep their source list too. The response's `listId` is the campaign's own list for a `leads` array, or the source list for a `listId` import.

List the leads in a campaign GET

**JavaScript SDK:** [`swarmhit.campaigns.leads.list(campaignId, params?)`](/smart-api/sdk/methods#campaigns.leads) The leads in a campaign and each one's progress (stage, step, invite sent/accepted, replied, label), newest first. The filters combine: for example `stage=invited&accountId=…` lists the leads whose connection request from that account waits for an answer, and `reachedStepId=…&label=interested` the interested leads among those a step reached. Step ids are the `sequence.steps[].id` of `GET /campaigns/{id}`.