Import Leads from List to Campaign
curl --request POST \
--url https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"listId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filter": {
"leadIds": [
"<string>"
],
"where": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"orderBy": [
{
"field": "<string>"
}
],
"limit": 2500
}
}
'import requests
url = "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list"
payload = {
"listId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filter": {
"leadIds": ["<string>"],
"where": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"orderBy": [{ "field": "<string>" }],
"limit": 2500
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
listId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
filter: {
leadIds: ['<string>'],
where: [{field: '<string>', value: '<unknown>'}],
orderBy: [{field: '<string>'}],
limit: 2500
}
})
};
fetch('https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'filter' => [
'leadIds' => [
'<string>'
],
'where' => [
[
'field' => '<string>',
'value' => '<unknown>'
]
],
'orderBy' => [
[
'field' => '<string>'
]
],
'limit' => 2500
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list"
payload := strings.NewReader("{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}"
response = http.request(request)
puts response.read_body{
"imported": 4503599627370495,
"duplicates": 4503599627370495,
"invalid": 4503599627370495,
"errors": 4503599627370495,
"total": 4503599627370495,
"partial": true
}{
"imported": 4503599627370495,
"duplicates": 4503599627370495,
"invalid": 4503599627370495,
"errors": 4503599627370495,
"total": 4503599627370495,
"partial": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Outbound Contacts
Import Leads from List to Campaign
Bulk-import every row of a user-owned list into a campaign as leads, pulling enrichment data from profile_data.
POST
/
api
/
campaigns
/
{id}
/
leads
/
import-from-list
Import Leads from List to Campaign
curl --request POST \
--url https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"listId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filter": {
"leadIds": [
"<string>"
],
"where": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"orderBy": [
{
"field": "<string>"
}
],
"limit": 2500
}
}
'import requests
url = "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list"
payload = {
"listId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filter": {
"leadIds": ["<string>"],
"where": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"orderBy": [{ "field": "<string>" }],
"limit": 2500
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
listId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
filter: {
leadIds: ['<string>'],
where: [{field: '<string>', value: '<unknown>'}],
orderBy: [{field: '<string>'}],
limit: 2500
}
})
};
fetch('https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'filter' => [
'leadIds' => [
'<string>'
],
'where' => [
[
'field' => '<string>',
'value' => '<unknown>'
]
],
'orderBy' => [
[
'field' => '<string>'
]
],
'limit' => 2500
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list"
payload := strings.NewReader("{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/campaigns/{id}/leads/import-from-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"filter\": {\n \"leadIds\": [\n \"<string>\"\n ],\n \"where\": [\n {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n ],\n \"orderBy\": [\n {\n \"field\": \"<string>\"\n }\n ],\n \"limit\": 2500\n }\n}"
response = http.request(request)
puts response.read_body{
"imported": 4503599627370495,
"duplicates": 4503599627370495,
"invalid": 4503599627370495,
"errors": 4503599627370495,
"total": 4503599627370495,
"partial": true
}{
"imported": 4503599627370495,
"duplicates": 4503599627370495,
"invalid": 4503599627370495,
"errors": 4503599627370495,
"total": 4503599627370495,
"partial": true
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}CLI:
pixie campaign lead import --id <id> --list-id <list-id>
pixie campaign lead import --id <id> --list-id <list-id> --filter <filter>
Overview
Hydrates canonical Leads from a saved List into the campaign as leads. The server pages through/api/lists/{id}/leads style canonical memberships and maps each Lead into the campaign lead shape.
- LinkedIn campaigns use the Lead’s LinkedIn social URL.
- Email campaigns use the Lead’s work-email contact or email attribute when present.
- Profile fields come from canonical Lead fields and Lead attributes.
AI agent notes
Channel-specific validation. Email campaigns require a usable email on the Lead. LinkedIn campaigns require a real LinkedIn URL on the Lead’s socials.Response shapes.
200— import succeeded (fully or partially);imported,duplicates,invalid,errors,totalall returned.206— a page fetch failed mid-run after earlier rows had already committed.partial: true. Retry with the samelistIdto pick up remaining rows — already-imported leads will be rejected as duplicates.422— the list was readable but zero leads could be imported: every row invalid, every row a duplicate, or a mix of the two with zero new inserts. The response body still contains the count breakdown.500— failed to fetch any list rows, or every insert batch errored.
206 with partial: true rather than rolling back. Agents should surface this as “imported so far” in UI.Dedup semantics. Same as addLeadsToCampaign — the unique constraint is (campaign_id, email) for email campaigns and (campaign_id, linkedin_url) for LinkedIn campaigns.Memory. Paginated fetch + batched insert keeps memory bounded for large lists.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Campaign UUID
Response
Import succeeded with row-count breakdown.
Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Required range:
0 <= x <= 9007199254740991Was this page helpful?