curl --request POST \
--url https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"phone_number": "+49123456789",
"placeholders": {
"first_name": "Jane",
"order_id": "12345"
},
"profile_id": 123,
"name": "Jane Doe"
}
],
"reset": false,
"is_last": false
}
'import requests
url = "https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients"
payload = {
"recipients": [
{
"phone_number": "+49123456789",
"placeholders": {
"first_name": "Jane",
"order_id": "12345"
},
"profile_id": 123,
"name": "Jane Doe"
}
],
"reset": False,
"is_last": False
}
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({
recipients: [
{
phone_number: '+49123456789',
placeholders: {first_name: 'Jane', order_id: '12345'},
profile_id: 123,
name: 'Jane Doe'
}
],
reset: false,
is_last: false
})
};
fetch('https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients', 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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients",
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([
'recipients' => [
[
'phone_number' => '+49123456789',
'placeholders' => [
'first_name' => 'Jane',
'order_id' => '12345'
],
'profile_id' => 123,
'name' => 'Jane Doe'
]
],
'reset' => false,
'is_last' => false
]),
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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients")
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 \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"received": 1000,
"inserted": 987,
"skipped": 13,
"total": 4187,
"finalized": false
}
}Append a batch of recipients to a campaign by ID.
Only campaigns with status “draft” can be modified. Meant for recipient lists that are too large for a single request: call this repeatedly and set “is_last” on the final batch. Send “reset” with the first batch to replace the existing list. Phone numbers are normalized, duplicates inside the batch and numbers already stored for the campaign are skipped. A batch can therefore be sent again after a timeout without creating duplicates.
curl --request POST \
--url https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"phone_number": "+49123456789",
"placeholders": {
"first_name": "Jane",
"order_id": "12345"
},
"profile_id": 123,
"name": "Jane Doe"
}
],
"reset": false,
"is_last": false
}
'import requests
url = "https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients"
payload = {
"recipients": [
{
"phone_number": "+49123456789",
"placeholders": {
"first_name": "Jane",
"order_id": "12345"
},
"profile_id": 123,
"name": "Jane Doe"
}
],
"reset": False,
"is_last": False
}
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({
recipients: [
{
phone_number: '+49123456789',
placeholders: {first_name: 'Jane', order_id: '12345'},
profile_id: 123,
name: 'Jane Doe'
}
],
reset: false,
is_last: false
})
};
fetch('https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients', 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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients",
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([
'recipients' => [
[
'phone_number' => '+49123456789',
'placeholders' => [
'first_name' => 'Jane',
'order_id' => '12345'
],
'profile_id' => 123,
'name' => 'Jane Doe'
]
],
'reset' => false,
'is_last' => false
]),
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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\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://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant_domain}/third-party/v1/whatsapp/campaigns/{id}/recipients")
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 \"recipients\": [\n {\n \"phone_number\": \"+49123456789\",\n \"placeholders\": {\n \"first_name\": \"Jane\",\n \"order_id\": \"12345\"\n },\n \"profile_id\": 123,\n \"name\": \"Jane Doe\"\n }\n ],\n \"reset\": false,\n \"is_last\": false\n}"
response = http.request(request)
puts response.read_body{
"data": {
"received": 1000,
"inserted": 987,
"skipped": 13,
"total": 4187,
"finalized": false
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
5000Show child attributes
Show child attributes
Delete all recipients currently stored on the campaign before inserting this batch. Send it with the first batch to restart an upload from scratch.
Marks the final batch of an upload. Finalizes the upload, writes a campaign log entry and returns the campaign instead of the batch result.
Response
Success. Intermediate batches return the result of the batch. The final batch ("is_last" = true) returns the campaign itself with the batch result in "meta".
- Option 1
- Option 2
Show child attributes
Show child attributes