Skip to main content
POST
/
v1
/
lead-extractor
/
campaigns
curl -X POST https://api.sendpilot.ai/v1/lead-extractor/campaigns \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech Startup Founders",
    "urls": [
      "https://www.linkedin.com/search/results/people/?keywords=CEO%20startup"
    ],
    "limit": 100,
    "url_type": "linkedin_search",
    "mode": "with_enrichment"
  }'
const response = await fetch('https://api.sendpilot.ai/v1/lead-extractor/campaigns', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.SENDPILOT_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Tech Startup Founders',
    urls: ['https://www.linkedin.com/search/results/people/?keywords=CEO%20startup'],
    limit: 100,
    url_type: 'linkedin_search',
    mode: 'with_enrichment'
  })
});
const result = await response.json();
import requests

response = requests.post(
    'https://api.sendpilot.ai/v1/lead-extractor/campaigns',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'name': 'Tech Startup Founders',
        'urls': ['https://www.linkedin.com/search/results/people/?keywords=CEO%20startup'],
        'limit': 100,
        'url_type': 'linkedin_search',
        'mode': 'with_enrichment'
    }
)
result = response.json()
{
  "id": "camp_abc123xyz",
  "name": "Tech Startup Founders",
  "status": "pending",
  "created_at": "2024-02-24T10:30:00.000Z",
  "estimated_credits": 200
}
{
  "statusCode": 400,
  "error": "Bad Request",
  "code": "NO_LINKEDIN_ACCOUNT",
  "message": "No active LinkedIn account found in workspace. Please connect a LinkedIn account first."
}
{
  "statusCode": 403,
  "error": "Forbidden",
  "code": "INSUFFICIENT_CREDITS",
  "message": "Insufficient credits. Required: 200, Available: 50"
}
Initiates a lead extraction campaign to scrape leads from LinkedIn search results. Requires an active LinkedIn account connected to your workspace.

Request

X-API-Key
string
required
Your API key
name
string
required
A name for this extraction campaign
urls
string[]
required
LinkedIn search URLs to extract leads from
limit
number
required
Maximum number of leads to extract (1-10000)
url_type
string
default:"linkedin_search"
Type of URLs provided: linkedin_search or sales_navigator
mode
string
default:"extraction_only"
Extraction mode: extraction_only or with_enrichment

Response

id
string
Unique identifier for the campaign
name
string
Name of the campaign
status
string
Current status: pending, running, completed, failed, cancelled
created_at
string
ISO 8601 timestamp when the campaign was created
estimated_credits
number
Estimated credits that will be consumed
curl -X POST https://api.sendpilot.ai/v1/lead-extractor/campaigns \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech Startup Founders",
    "urls": [
      "https://www.linkedin.com/search/results/people/?keywords=CEO%20startup"
    ],
    "limit": 100,
    "url_type": "linkedin_search",
    "mode": "with_enrichment"
  }'
const response = await fetch('https://api.sendpilot.ai/v1/lead-extractor/campaigns', {
  method: 'POST',
  headers: {
    'X-API-Key': process.env.SENDPILOT_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Tech Startup Founders',
    urls: ['https://www.linkedin.com/search/results/people/?keywords=CEO%20startup'],
    limit: 100,
    url_type: 'linkedin_search',
    mode: 'with_enrichment'
  })
});
const result = await response.json();
import requests

response = requests.post(
    'https://api.sendpilot.ai/v1/lead-extractor/campaigns',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'name': 'Tech Startup Founders',
        'urls': ['https://www.linkedin.com/search/results/people/?keywords=CEO%20startup'],
        'limit': 100,
        'url_type': 'linkedin_search',
        'mode': 'with_enrichment'
    }
)
result = response.json()
{
  "id": "camp_abc123xyz",
  "name": "Tech Startup Founders",
  "status": "pending",
  "created_at": "2024-02-24T10:30:00.000Z",
  "estimated_credits": 200
}
{
  "statusCode": 400,
  "error": "Bad Request",
  "code": "NO_LINKEDIN_ACCOUNT",
  "message": "No active LinkedIn account found in workspace. Please connect a LinkedIn account first."
}
{
  "statusCode": 403,
  "error": "Forbidden",
  "code": "INSUFFICIENT_CREDITS",
  "message": "Insufficient credits. Required: 200, Available: 50"
}
Credits are calculated as: 1 credit per lead for extraction, plus 1 additional credit per lead if enrichment is enabled.

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
name
string
required

A name for this extraction campaign

urls
string[]
required

LinkedIn search URLs to extract leads from

Minimum array length: 1
limit
integer
required

Maximum number of leads to extract

Required range: 1 <= x <= 10000
url_type
enum<string>
default:linkedin_search

Type of URLs provided

Available options:
linkedin_search,
sales_navigator
mode
enum<string>
default:extraction_only

Extraction mode

Available options:
extraction_only,
with_enrichment

Response

Campaign created successfully

id
string
required
status
enum<string>
required
Available options:
pending,
running,
completed,
failed,
cancelled
name
string
created_at
string<date-time>
estimated_credits
integer

Estimated credits that will be consumed