Outbound
Add Leads
Adds new leads to a specified outbound
POST
/
v2
/
Outbound
/
{pearlId}
/
Leads
/
Add
Add Leads
curl --request POST \
--url https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leads": [
{
"phoneNumber": "<string>",
"externalId": "<string>",
"timeZoneId": "<string>",
"callData": {}
}
]
}
'import requests
url = "https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add"
payload = { "leads": [
{
"phoneNumber": "<string>",
"externalId": "<string>",
"timeZoneId": "<string>",
"callData": {}
}
] }
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({
leads: [
{
phoneNumber: '<string>',
externalId: '<string>',
timeZoneId: '<string>',
callData: {}
}
]
})
};
fetch('https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add', 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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add",
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([
'leads' => [
[
'phoneNumber' => '<string>',
'externalId' => '<string>',
'timeZoneId' => '<string>',
'callData' => [
]
]
]
]),
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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add"
payload := strings.NewReader("{\n \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add")
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 \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodytrue{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}Authorizations
bearer_authoauth2
Specify the authorization token in the form AccountId:SecretKey, or an OAuth 2.0 access token.
For more information, check out the Authorization Guide and the OAuth 2.0 Guide.
Path Parameters
Body
application/jsontext/jsonapplication/*+json
Collection of leads to add to an outbound Pearl.
Constraints:
- Max 50,000 leads.
- Each lead must follow the validation rules defined in LeadToAddApi.
Show child attributes
Show child attributes
Response
All leads were added successfully.
The response is of type boolean.
⌘I
Add Leads
curl --request POST \
--url https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"leads": [
{
"phoneNumber": "<string>",
"externalId": "<string>",
"timeZoneId": "<string>",
"callData": {}
}
]
}
'import requests
url = "https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add"
payload = { "leads": [
{
"phoneNumber": "<string>",
"externalId": "<string>",
"timeZoneId": "<string>",
"callData": {}
}
] }
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({
leads: [
{
phoneNumber: '<string>',
externalId: '<string>',
timeZoneId: '<string>',
callData: {}
}
]
})
};
fetch('https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add', 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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add",
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([
'leads' => [
[
'phoneNumber' => '<string>',
'externalId' => '<string>',
'timeZoneId' => '<string>',
'callData' => [
]
]
]
]),
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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add"
payload := strings.NewReader("{\n \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\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://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nlpearl.ai/v2/Outbound/{pearlId}/Leads/Add")
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 \"leads\": [\n {\n \"phoneNumber\": \"<string>\",\n \"externalId\": \"<string>\",\n \"timeZoneId\": \"<string>\",\n \"callData\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_bodytrue{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}
