Add Targets
curl --request POST \
--url https://api.example.com/api/v1/campaigns/{campaign_id}/targets \
--header 'Content-Type: application/json' \
--data '
{
"targets": [
{
"fallback_phone_number": "+19876543210",
"input_data": {
"appointment_date": "2026-04-01",
"appointment_type": "Follow-up"
},
"patient": {
"date_of_birth": "1990-01-15",
"external_id": "PAT-001",
"extra_data": {
"address": "123 Main St, Anytown, USA"
},
"first_name": "John",
"last_name": "Doe"
},
"phone_number": "+1234567890",
"pre_call_data": {
"patient_name": "John Doe"
}
}
],
"launch": false,
"allow_duplicates": true
}
'import requests
url = "https://api.example.com/api/v1/campaigns/{campaign_id}/targets"
payload = {
"targets": [
{
"fallback_phone_number": "+19876543210",
"input_data": {
"appointment_date": "2026-04-01",
"appointment_type": "Follow-up"
},
"patient": {
"date_of_birth": "1990-01-15",
"external_id": "PAT-001",
"extra_data": { "address": "123 Main St, Anytown, USA" },
"first_name": "John",
"last_name": "Doe"
},
"phone_number": "+1234567890",
"pre_call_data": { "patient_name": "John Doe" }
}
],
"launch": False,
"allow_duplicates": True
}
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: [
{
fallback_phone_number: '+19876543210',
input_data: {appointment_date: '2026-04-01', appointment_type: 'Follow-up'},
patient: {
date_of_birth: '1990-01-15',
external_id: 'PAT-001',
extra_data: {address: '123 Main St, Anytown, USA'},
first_name: 'John',
last_name: 'Doe'
},
phone_number: '+1234567890',
pre_call_data: {patient_name: 'John Doe'}
}
],
launch: false,
allow_duplicates: true
})
};
fetch('https://api.example.com/api/v1/campaigns/{campaign_id}/targets', 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.example.com/api/v1/campaigns/{campaign_id}/targets",
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' => [
[
'fallback_phone_number' => '+19876543210',
'input_data' => [
'appointment_date' => '2026-04-01',
'appointment_type' => 'Follow-up'
],
'patient' => [
'date_of_birth' => '1990-01-15',
'external_id' => 'PAT-001',
'extra_data' => [
'address' => '123 Main St, Anytown, USA'
],
'first_name' => 'John',
'last_name' => 'Doe'
],
'phone_number' => '+1234567890',
'pre_call_data' => [
'patient_name' => 'John Doe'
]
]
],
'launch' => false,
'allow_duplicates' => true
]),
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://api.example.com/api/v1/campaigns/{campaign_id}/targets"
payload := strings.NewReader("{\n \"targets\": [\n {\n \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\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://api.example.com/api/v1/campaigns/{campaign_id}/targets")
.header("Content-Type", "application/json")
.body("{\n \"targets\": [\n {\n \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/campaigns/{campaign_id}/targets")
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 \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Campaigns
Add Targets
Add targets to a campaign
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
targets
Add Targets
curl --request POST \
--url https://api.example.com/api/v1/campaigns/{campaign_id}/targets \
--header 'Content-Type: application/json' \
--data '
{
"targets": [
{
"fallback_phone_number": "+19876543210",
"input_data": {
"appointment_date": "2026-04-01",
"appointment_type": "Follow-up"
},
"patient": {
"date_of_birth": "1990-01-15",
"external_id": "PAT-001",
"extra_data": {
"address": "123 Main St, Anytown, USA"
},
"first_name": "John",
"last_name": "Doe"
},
"phone_number": "+1234567890",
"pre_call_data": {
"patient_name": "John Doe"
}
}
],
"launch": false,
"allow_duplicates": true
}
'import requests
url = "https://api.example.com/api/v1/campaigns/{campaign_id}/targets"
payload = {
"targets": [
{
"fallback_phone_number": "+19876543210",
"input_data": {
"appointment_date": "2026-04-01",
"appointment_type": "Follow-up"
},
"patient": {
"date_of_birth": "1990-01-15",
"external_id": "PAT-001",
"extra_data": { "address": "123 Main St, Anytown, USA" },
"first_name": "John",
"last_name": "Doe"
},
"phone_number": "+1234567890",
"pre_call_data": { "patient_name": "John Doe" }
}
],
"launch": False,
"allow_duplicates": True
}
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: [
{
fallback_phone_number: '+19876543210',
input_data: {appointment_date: '2026-04-01', appointment_type: 'Follow-up'},
patient: {
date_of_birth: '1990-01-15',
external_id: 'PAT-001',
extra_data: {address: '123 Main St, Anytown, USA'},
first_name: 'John',
last_name: 'Doe'
},
phone_number: '+1234567890',
pre_call_data: {patient_name: 'John Doe'}
}
],
launch: false,
allow_duplicates: true
})
};
fetch('https://api.example.com/api/v1/campaigns/{campaign_id}/targets', 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.example.com/api/v1/campaigns/{campaign_id}/targets",
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' => [
[
'fallback_phone_number' => '+19876543210',
'input_data' => [
'appointment_date' => '2026-04-01',
'appointment_type' => 'Follow-up'
],
'patient' => [
'date_of_birth' => '1990-01-15',
'external_id' => 'PAT-001',
'extra_data' => [
'address' => '123 Main St, Anytown, USA'
],
'first_name' => 'John',
'last_name' => 'Doe'
],
'phone_number' => '+1234567890',
'pre_call_data' => [
'patient_name' => 'John Doe'
]
]
],
'launch' => false,
'allow_duplicates' => true
]),
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://api.example.com/api/v1/campaigns/{campaign_id}/targets"
payload := strings.NewReader("{\n \"targets\": [\n {\n \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\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://api.example.com/api/v1/campaigns/{campaign_id}/targets")
.header("Content-Type", "application/json")
.body("{\n \"targets\": [\n {\n \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/campaigns/{campaign_id}/targets")
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 \"fallback_phone_number\": \"+19876543210\",\n \"input_data\": {\n \"appointment_date\": \"2026-04-01\",\n \"appointment_type\": \"Follow-up\"\n },\n \"patient\": {\n \"date_of_birth\": \"1990-01-15\",\n \"external_id\": \"PAT-001\",\n \"extra_data\": {\n \"address\": \"123 Main St, Anytown, USA\"\n },\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n },\n \"phone_number\": \"+1234567890\",\n \"pre_call_data\": {\n \"patient_name\": \"John Doe\"\n }\n }\n ],\n \"launch\": false,\n \"allow_duplicates\": true\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
The ID of the campaign to add targets to.
Body
application/json
The list of targets as TargetInputs
Show child attributes
Show child attributes
Example:
[
{
"fallback_phone_number": "+19876543210",
"input_data": {
"appointment_date": "2026-04-01",
"appointment_type": "Follow-up"
},
"patient": {
"date_of_birth": "1990-01-15",
"external_id": "PAT-001",
"extra_data": { "address": "123 Main St, Anytown, USA" },
"first_name": "John",
"last_name": "Doe"
},
"phone_number": "+1234567890",
"pre_call_data": { "patient_name": "John Doe" }
}
]
Whether to launch the targets immediately or only add them to the campaign
When set to True all targets with and external ID already contained in the campaign will be ignored
Response
Successful Response
⌘I