Import leads from JSON array
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json \
--header 'Content-Type: application/json' \
--data '
{
"targets": [
{
"externalId": "li_123",
"fullName": "Jane Doe",
"company": "Acme",
"profileUrl": "https://linkedin.com/in/jane-doe"
}
]
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json"
payload = { "targets": [
{
"externalId": "li_123",
"fullName": "Jane Doe",
"company": "Acme",
"profileUrl": "https://linkedin.com/in/jane-doe"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
targets: [
{
externalId: 'li_123',
fullName: 'Jane Doe',
company: 'Acme',
profileUrl: 'https://linkedin.com/in/jane-doe'
}
]
})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json', 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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json",
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([
'targets' => [
[
'externalId' => 'li_123',
'fullName' => 'Jane Doe',
'company' => 'Acme',
'profileUrl' => 'https://linkedin.com/in/jane-doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json"
payload := strings.NewReader("{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json")
.header("Content-Type", "application/json")
.body("{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"imported": 10,
"duplicates": 0,
"invalid": 0
}
}Prospects
Import leads from JSON array
Adds a JSON array of direct API leads. For a dashboard-aligned CSV import, use the import-csv endpoint instead.
POST
/
api
/
v1
/
platforms
/
{platform}
/
prospect-lists
/
{listId}
/
leads
/
import-json
Import leads from JSON array
curl --request POST \
--url https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json \
--header 'Content-Type: application/json' \
--data '
{
"targets": [
{
"externalId": "li_123",
"fullName": "Jane Doe",
"company": "Acme",
"profileUrl": "https://linkedin.com/in/jane-doe"
}
]
}
'import requests
url = "https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json"
payload = { "targets": [
{
"externalId": "li_123",
"fullName": "Jane Doe",
"company": "Acme",
"profileUrl": "https://linkedin.com/in/jane-doe"
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
targets: [
{
externalId: 'li_123',
fullName: 'Jane Doe',
company: 'Acme',
profileUrl: 'https://linkedin.com/in/jane-doe'
}
]
})
};
fetch('https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json', 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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json",
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([
'targets' => [
[
'externalId' => 'li_123',
'fullName' => 'Jane Doe',
'company' => 'Acme',
'profileUrl' => 'https://linkedin.com/in/jane-doe'
]
]
]),
CURLOPT_HTTPHEADER => [
"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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json"
payload := strings.NewReader("{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json")
.header("Content-Type", "application/json")
.body("{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://optareach.com/api/v1/platforms/{platform}/prospect-lists/{listId}/leads/import-json")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targets\": [\n {\n \"externalId\": \"li_123\",\n \"fullName\": \"Jane Doe\",\n \"company\": \"Acme\",\n \"profileUrl\": \"https://linkedin.com/in/jane-doe\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"imported": 10,
"duplicates": 0,
"invalid": 0
}
}