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

JavaScript SDK: swarmhit.campaigns.leads.list(campaignId, params?)

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}.

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string

Query Parameters

limit?integer

Page size, 1–100.

Range1 <= value <= 100
Default50
offset?integer

Number of records to skip.

Range0 <= value
Default0
stage?string

Only leads at this stage, as the app's Status column shows it.

Value in

  • "pending"
  • "invited"
  • "accepted"
  • "messaged"
  • "call_pending"
  • "in_progress"
  • "done"
  • "replied"
  • "failed"
  • "paused"
  • "stopped"
status?string

Only return leads at this progress status in the campaign.

Value in

  • "pending"
  • "running"
  • "done"
  • "failed"
  • "paused"
  • "replied"
  • "stopped"
label?string

Only leads with this label in their campaign, or none for those without one.

Value in

  • "interested"
  • "not_interested"
  • "neutral"
  • "out_of_office"
  • "none"
currentStepId?string

Only leads on this step of the sequence now (their currentStepId), whatever their stage: what the app calls "here now" on the step. A step id that isn't in the campaign's sequence is a 400.

reachedStepId?string

Only leads that reached this step of the sequence: the number on the step in the app. A lead reached a step when its history has an entry for the step that went through (an email's opens and clicks don't count), or when the step's invite or message is sent and still waits for an answer. A step id that isn't in the campaign's sequence is a 400.

accountId?string

Only leads assigned to this account: a LinkedIn account, a mailbox or a WhatsApp number (linkedinAccountId, emailAccountId or whatsappAccountId on the lead).

search?string

Case-insensitive match on the lead's name, headline, job title, email, company or profile slug (publicIdentifier), as on GET /leads. A full LinkedIn profile URL is reduced to its slug first. Reads at most 25,000 of the campaign's leads: past that, add another filter (400, code: search-too-broad).

Response Body

application/json

application/json

application/json

application/json

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