API referenceLead imports
POST
/lead-imports/{id}/cancel

JavaScript SDK: swarmhit.leadImports.cancel(leadImportId)

Authorization

bearerAuth
AuthorizationBearer <token>

An API key created on the Access tokens page.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/lead-imports/string/cancel"
{  "data": {    "id": "string",    "name": "string",    "linkedinAccountId": "string",    "status": "pending",    "input": {      "mode": "url",      "url": "string",      "params": {}    },    "destination": {      "listId": "string",      "listAutoCreated": true    },    "tags": [      "string"    ],    "maxLeads": 0,    "progress": {      "fetchedPages": 0,      "fetchedItems": 0,      "importedLeads": 0,      "skippedItems": 0,      "totalCount": 0    },    "nextPageAt": "2019-08-24T14:15:22Z",    "error": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "startedAt": "2019-08-24T14:15:22Z",    "completedAt": "2019-08-24T14:15:22Z"  }}

Pull a sender's recent chats from LinkedIn POST

**JavaScript SDK:** [`swarmhit.inbox.sync(params)`](/smart-api/sdk/methods#inbox) Fetches the sender's most recent LinkedIn conversations now and keeps the ones with a workspace lead or campaign lead. `limit` 1–100, default 50. 409 `account_not_connected` when the sender has no live LinkedIn connection; 503 `provider_unavailable` when LinkedIn can't be reached right now.

Start a LinkedIn search import POST

**JavaScript SDK:** [`swarmhit.leadImports.create(params)`](/smart-api/sdk/methods#leadImports) Kicks off a paginated import from a LinkedIn / Sales Navigator search against the connected `accountId`. Returns immediately with the import `running` — the worker fetches the first page within a minute. Each stored lead counts toward the sender's daily search-import limit; when it is reached the import waits until midnight UTC and stays `running`. An unknown or disconnected `accountId`, a Sales Navigator search on a sender without Sales Navigator, or an unknown `listId` / `campaignId` is a 400 (an unknown id has `code: not-found`), as is sending both or neither of `url` and `params`. Provide **either**: - `url`: a copied LinkedIn search URL (classic or Sales Navigator), or - `params`: a structured filter blob (`{ api, category, keywords, ... }`). Imported leads land in `listId` if provided; otherwise a new list is auto-created and returned in the response. With `campaignId` instead, they land in that campaign's own list (created if it doesn't exist yet) and are enrolled in the campaign page by page, subject to its exclusion rules.