Create WhatsApp campaign
Send an approved template to many people, personalised for each one, now or at a set time. Opted-out numbers are skipped; each message is charged as it’s sent.
Scope: whatsapp:send.
If the wallet runs out mid-way the campaign stops with status failed; top up and resume it with Update WhatsApp campaign. Nobody is charged or messaged twice.
POST
/
whatsapp
/
campaigns
Create WhatsApp campaign
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "November offer",
"templateId": "7d2c…",
"upload": [
{
"phone": "0712345678",
"name": "Jane Wanjiku",
"fields": {
"code": "JANE10"
}
},
{
"phone": "0722000111",
"name": "Otieno",
"fields": {
"code": "OTI10"
}
}
],
"variableMap": {
"body": {
"1": {
"source": "contact",
"field": "first_name"
},
"2": {
"source": "column",
"column": "code"
}
}
},
"scheduledAt": "2026-11-20T09:00:00+03:00"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'November offer',
templateId: '7d2c…',
upload: [
{phone: '0712345678', name: 'Jane Wanjiku', fields: {code: 'JANE10'}},
{phone: '0722000111', name: 'Otieno', fields: {code: 'OTI10'}}
],
variableMap: {
body: JSON.stringify({
'1': {source: 'contact', field: 'first_name'},
'2': {source: 'column', column: 'code'}
})
},
scheduledAt: '2026-11-20T09:00:00+03:00'
})
};
fetch('https://app.telaven.com/api/v1/whatsapp/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/campaigns"
payload = {
"name": "November offer",
"templateId": "7d2c…",
"upload": [
{
"phone": "0712345678",
"name": "Jane Wanjiku",
"fields": { "code": "JANE10" }
},
{
"phone": "0722000111",
"name": "Otieno",
"fields": { "code": "OTI10" }
}
],
"variableMap": { "body": {
"1": {
"source": "contact",
"field": "first_name"
},
"2": {
"source": "column",
"column": "code"
}
} },
"scheduledAt": "2026-11-20T09:00:00+03:00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/campaigns",
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([
'name' => 'November offer',
'templateId' => '7d2c…',
'upload' => [
[
'phone' => '0712345678',
'name' => 'Jane Wanjiku',
'fields' => [
'code' => 'JANE10'
]
],
[
'phone' => '0722000111',
'name' => 'Otieno',
'fields' => [
'code' => 'OTI10'
]
]
],
'variableMap' => [
'body' => [
'1' => [
'source' => 'contact',
'field' => 'first_name'
],
'2' => [
'source' => 'column',
'column' => 'code'
]
]
],
'scheduledAt' => '2026-11-20T09:00:00+03:00'
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/campaigns");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"November offer\",\n \"templateId\": \"7d2c…\",\n \"upload\": [\n {\n \"phone\": \"0712345678\",\n \"name\": \"Jane Wanjiku\",\n \"fields\": {\n \"code\": \"JANE10\"\n }\n },\n {\n \"phone\": \"0722000111\",\n \"name\": \"Otieno\",\n \"fields\": {\n \"code\": \"OTI10\"\n }\n }\n ],\n \"variableMap\": {\n \"body\": {\n \"1\": {\n \"source\": \"contact\",\n \"field\": \"first_name\"\n },\n \"2\": {\n \"source\": \"column\",\n \"column\": \"code\"\n }\n }\n },\n \"scheduledAt\": \"2026-11-20T09:00:00+03:00\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"data": {
"id": "c51a…",
"name": "November offer",
"status": "scheduled",
"totalRecipients": 2,
"estimatedCostCents": 300,
"scheduledAt": "2026-11-20T06:00:00.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Headers
Body
application/json
Where each variable's value comes from, per recipient. { body: { "1": source }, header?: {…}, buttons?: { "0": source } }, where a source is { source: "contact", field: "name" | "first_name" | "phone" | "email" }, { source: "column", column } (from upload[].fields) or { source: "fixed", value }.
Response
Success
⌘I
Create WhatsApp campaign
curl --request POST \
--url https://app.telaven.com/api/v1/whatsapp/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "November offer",
"templateId": "7d2c…",
"upload": [
{
"phone": "0712345678",
"name": "Jane Wanjiku",
"fields": {
"code": "JANE10"
}
},
{
"phone": "0722000111",
"name": "Otieno",
"fields": {
"code": "OTI10"
}
}
],
"variableMap": {
"body": {
"1": {
"source": "contact",
"field": "first_name"
},
"2": {
"source": "column",
"column": "code"
}
}
},
"scheduledAt": "2026-11-20T09:00:00+03:00"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'November offer',
templateId: '7d2c…',
upload: [
{phone: '0712345678', name: 'Jane Wanjiku', fields: {code: 'JANE10'}},
{phone: '0722000111', name: 'Otieno', fields: {code: 'OTI10'}}
],
variableMap: {
body: JSON.stringify({
'1': {source: 'contact', field: 'first_name'},
'2': {source: 'column', column: 'code'}
})
},
scheduledAt: '2026-11-20T09:00:00+03:00'
})
};
fetch('https://app.telaven.com/api/v1/whatsapp/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.telaven.com/api/v1/whatsapp/campaigns"
payload = {
"name": "November offer",
"templateId": "7d2c…",
"upload": [
{
"phone": "0712345678",
"name": "Jane Wanjiku",
"fields": { "code": "JANE10" }
},
{
"phone": "0722000111",
"name": "Otieno",
"fields": { "code": "OTI10" }
}
],
"variableMap": { "body": {
"1": {
"source": "contact",
"field": "first_name"
},
"2": {
"source": "column",
"column": "code"
}
} },
"scheduledAt": "2026-11-20T09:00:00+03:00"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.telaven.com/api/v1/whatsapp/campaigns",
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([
'name' => 'November offer',
'templateId' => '7d2c…',
'upload' => [
[
'phone' => '0712345678',
'name' => 'Jane Wanjiku',
'fields' => [
'code' => 'JANE10'
]
],
[
'phone' => '0722000111',
'name' => 'Otieno',
'fields' => [
'code' => 'OTI10'
]
]
],
'variableMap' => [
'body' => [
'1' => [
'source' => 'contact',
'field' => 'first_name'
],
'2' => [
'source' => 'column',
'column' => 'code'
]
]
],
'scheduledAt' => '2026-11-20T09:00:00+03:00'
]),
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;
}using RestSharp;
var options = new RestClientOptions("https://app.telaven.com/api/v1/whatsapp/campaigns");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"name\": \"November offer\",\n \"templateId\": \"7d2c…\",\n \"upload\": [\n {\n \"phone\": \"0712345678\",\n \"name\": \"Jane Wanjiku\",\n \"fields\": {\n \"code\": \"JANE10\"\n }\n },\n {\n \"phone\": \"0722000111\",\n \"name\": \"Otieno\",\n \"fields\": {\n \"code\": \"OTI10\"\n }\n }\n ],\n \"variableMap\": {\n \"body\": {\n \"1\": {\n \"source\": \"contact\",\n \"field\": \"first_name\"\n },\n \"2\": {\n \"source\": \"column\",\n \"column\": \"code\"\n }\n }\n },\n \"scheduledAt\": \"2026-11-20T09:00:00+03:00\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"success": true,
"data": {
"id": "c51a…",
"name": "November offer",
"status": "scheduled",
"totalRecipients": 2,
"estimatedCostCents": 300,
"scheduledAt": "2026-11-20T06:00:00.000Z"
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}