Create a click-to-WhatsApp ad
curl --request POST \
--url https://api.kavenio.com/v1/ads/ctwa \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "ad_account_example",
"name": "WhatsApp leads",
"headline": "Message us",
"body": "Chat with our team.",
"imageUrl": "https://cdn.example.com/ad.png",
"budgetAmount": 25,
"budgetType": "daily"
}
'import requests
url = "https://api.kavenio.com/v1/ads/ctwa"
payload = {
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "ad_account_example",
"name": "WhatsApp leads",
"headline": "Message us",
"body": "Chat with our team.",
"imageUrl": "https://cdn.example.com/ad.png",
"budgetAmount": 25,
"budgetType": "daily"
}
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({
accountId: 'bbbbbbbbbbbbbbbb',
adAccountId: 'ad_account_example',
name: 'WhatsApp leads',
headline: 'Message us',
body: JSON.stringify('Chat with our team.'),
imageUrl: 'https://cdn.example.com/ad.png',
budgetAmount: 25,
budgetType: 'daily'
})
};
fetch('https://api.kavenio.com/v1/ads/ctwa', 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.kavenio.com/v1/ads/ctwa",
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([
'accountId' => 'bbbbbbbbbbbbbbbb',
'adAccountId' => 'ad_account_example',
'name' => 'WhatsApp leads',
'headline' => 'Message us',
'body' => 'Chat with our team.',
'imageUrl' => 'https://cdn.example.com/ad.png',
'budgetAmount' => 25,
'budgetType' => 'daily'
]),
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.kavenio.com/v1/ads/ctwa"
payload := strings.NewReader("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\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.kavenio.com/v1/ads/ctwa")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kavenio.com/v1/ads/ctwa")
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 \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"ad": {
"_id": "<string>",
"name": "<string>",
"adType": "<string>",
"goal": "<string>",
"isExternal": true,
"budget": {
"amount": 123,
"type": "<string>"
},
"metrics": {
"spend": 123,
"impressions": 123,
"reach": 123,
"clicks": 123,
"ctr": 123,
"cpc": 123,
"cpm": 123,
"engagement": 123,
"conversions": 123,
"costPerConversion": 123,
"actions": {},
"actionValues": {},
"purchaseValue": 123,
"roas": 123,
"lastSyncedAt": "<string>"
},
"promotedObject": {},
"creative": {
"thumbnailUrl": "<string>",
"imageUrl": "<string>",
"videoId": "<string>",
"videoUrl": "<string>",
"objectType": "<string>",
"objectStoryId": "<string>",
"effectiveObjectStoryId": "<string>",
"effectiveInstagramMediaId": "<string>",
"instagramUserId": "<string>",
"instagramPermalinkUrl": "<string>",
"mediaUrls": [
"<string>"
],
"body": "<string>",
"googleHeadline": "<string>",
"googleDescription": "<string>",
"linkUrl": "<string>",
"pinterestImageUrl": "<string>",
"pinterestTitle": "<string>",
"pinterestDescription": "<string>"
},
"targeting": {},
"schedule": {
"startDate": "<string>",
"endDate": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>",
"platformAdId": "<string>",
"platformAdAccountId": "<string>",
"platformCampaignId": "<string>",
"platformAdSetId": "<string>",
"campaignName": "<string>",
"adSetName": "<string>",
"platformObjective": "<string>",
"optimizationGoal": "<string>",
"platformAdAccountName": "<string>",
"platformCreatedAt": "<string>",
"bidStrategy": "<string>",
"bidAmount": 123,
"roasAverageFloor": 123,
"rejectionReason": "<string>"
}
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Ads
Create a click-to-WhatsApp ad
Creates a Meta click-to-WhatsApp ad.
POST
/
v1
/
ads
/
ctwa
Create a click-to-WhatsApp ad
curl --request POST \
--url https://api.kavenio.com/v1/ads/ctwa \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "ad_account_example",
"name": "WhatsApp leads",
"headline": "Message us",
"body": "Chat with our team.",
"imageUrl": "https://cdn.example.com/ad.png",
"budgetAmount": 25,
"budgetType": "daily"
}
'import requests
url = "https://api.kavenio.com/v1/ads/ctwa"
payload = {
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "ad_account_example",
"name": "WhatsApp leads",
"headline": "Message us",
"body": "Chat with our team.",
"imageUrl": "https://cdn.example.com/ad.png",
"budgetAmount": 25,
"budgetType": "daily"
}
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({
accountId: 'bbbbbbbbbbbbbbbb',
adAccountId: 'ad_account_example',
name: 'WhatsApp leads',
headline: 'Message us',
body: JSON.stringify('Chat with our team.'),
imageUrl: 'https://cdn.example.com/ad.png',
budgetAmount: 25,
budgetType: 'daily'
})
};
fetch('https://api.kavenio.com/v1/ads/ctwa', 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.kavenio.com/v1/ads/ctwa",
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([
'accountId' => 'bbbbbbbbbbbbbbbb',
'adAccountId' => 'ad_account_example',
'name' => 'WhatsApp leads',
'headline' => 'Message us',
'body' => 'Chat with our team.',
'imageUrl' => 'https://cdn.example.com/ad.png',
'budgetAmount' => 25,
'budgetType' => 'daily'
]),
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.kavenio.com/v1/ads/ctwa"
payload := strings.NewReader("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\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.kavenio.com/v1/ads/ctwa")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kavenio.com/v1/ads/ctwa")
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 \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"ad_account_example\",\n \"name\": \"WhatsApp leads\",\n \"headline\": \"Message us\",\n \"body\": \"Chat with our team.\",\n \"imageUrl\": \"https://cdn.example.com/ad.png\",\n \"budgetAmount\": 25,\n \"budgetType\": \"daily\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"ad": {
"_id": "<string>",
"name": "<string>",
"adType": "<string>",
"goal": "<string>",
"isExternal": true,
"budget": {
"amount": 123,
"type": "<string>"
},
"metrics": {
"spend": 123,
"impressions": 123,
"reach": 123,
"clicks": 123,
"ctr": 123,
"cpc": 123,
"cpm": 123,
"engagement": 123,
"conversions": 123,
"costPerConversion": 123,
"actions": {},
"actionValues": {},
"purchaseValue": 123,
"roas": 123,
"lastSyncedAt": "<string>"
},
"promotedObject": {},
"creative": {
"thumbnailUrl": "<string>",
"imageUrl": "<string>",
"videoId": "<string>",
"videoUrl": "<string>",
"objectType": "<string>",
"objectStoryId": "<string>",
"effectiveObjectStoryId": "<string>",
"effectiveInstagramMediaId": "<string>",
"instagramUserId": "<string>",
"instagramPermalinkUrl": "<string>",
"mediaUrls": [
"<string>"
],
"body": "<string>",
"googleHeadline": "<string>",
"googleDescription": "<string>",
"linkUrl": "<string>",
"pinterestImageUrl": "<string>",
"pinterestTitle": "<string>",
"pinterestDescription": "<string>"
},
"targeting": {},
"schedule": {
"startDate": "<string>",
"endDate": "<string>"
},
"createdAt": "<string>",
"updatedAt": "<string>",
"platformAdId": "<string>",
"platformAdAccountId": "<string>",
"platformCampaignId": "<string>",
"platformAdSetId": "<string>",
"campaignName": "<string>",
"adSetName": "<string>",
"platformObjective": "<string>",
"optimizationGoal": "<string>",
"platformAdAccountName": "<string>",
"platformCreatedAt": "<string>",
"bidStrategy": "<string>",
"bidAmount": 123,
"roasAverageFloor": 123,
"rejectionReason": "<string>"
}
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"ok": true,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
16Pattern:
^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{16}$Minimum string length:
1Required string length:
1 - 255Available options:
daily, lifetime Required string length:
1 - 255Minimum string length:
1Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Required string length:
3Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$Minimum string length:
2Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
13 <= x <= 65Required range:
13 <= x <= 65Show child attributes
Show child attributes
Minimum string length:
1Available options:
OUTCOME_ENGAGEMENT, OUTCOME_SALES, OUTCOME_LEADS Available options:
LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS Maximum string length:
100Maximum string length:
100Was this page helpful?
⌘I