Create an ad audience
curl --request POST \
--url https://api.kavenio.com/v1/ads/audiences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "act_123",
"name": "Customers",
"type": "customer_list",
"description": "Uploaded customer audience"
}
'import requests
url = "https://api.kavenio.com/v1/ads/audiences"
payload = {
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "act_123",
"name": "Customers",
"type": "customer_list",
"description": "Uploaded customer audience"
}
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: 'act_123',
name: 'Customers',
type: 'customer_list',
description: 'Uploaded customer audience'
})
};
fetch('https://api.kavenio.com/v1/ads/audiences', 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/audiences",
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' => 'act_123',
'name' => 'Customers',
'type' => 'customer_list',
'description' => 'Uploaded customer audience'
]),
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/audiences"
payload := strings.NewReader("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\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/audiences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kavenio.com/v1/ads/audiences")
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\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"audience": {
"id": "<string>",
"platformAudienceId": "<string>",
"name": "<string>",
"platform": "<string>",
"status": "<string>",
"description": "<string>",
"spec": {
"countries": [
"<string>"
],
"regions": [
{
"key": "<string>",
"name": "<string>"
}
],
"cities": [
{
"key": "<string>",
"name": "<string>",
"radius": 123
}
],
"zips": [
{
"key": "<string>",
"name": "<string>"
}
],
"metros": [
{
"key": "<string>",
"name": "<string>"
}
],
"customLocations": [
{
"latitude": 0,
"longitude": 0,
"radius": 123,
"name": "<string>",
"address": "<string>"
}
],
"excludedLocations": {},
"ageMin": 56,
"ageMax": 56,
"languages": [
"<string>"
],
"interests": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"behaviors": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"demographics": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"industries": [
"<string>"
],
"companySizes": [
"<string>"
],
"seniorities": [
"<string>"
],
"jobFunctions": [
"<string>"
],
"audienceInclude": [
"<string>"
],
"audienceExclude": [
"<string>"
],
"placements": {},
"specialAdCategories": [
"<string>"
]
},
"accountId": "<string>",
"adAccountId": "<string>",
"size": 0,
"createdAt": "<string>",
"updatedAt": "<string>"
},
"metaData": {},
"message": "<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>"
}
}Ad audiences
Create an ad audience
Creates a provider-backed advertising audience. Requests use internal connected accountId plus platform-native adAccountId where required.
POST
/
v1
/
ads
/
audiences
Create an ad audience
curl --request POST \
--url https://api.kavenio.com/v1/ads/audiences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "act_123",
"name": "Customers",
"type": "customer_list",
"description": "Uploaded customer audience"
}
'import requests
url = "https://api.kavenio.com/v1/ads/audiences"
payload = {
"accountId": "bbbbbbbbbbbbbbbb",
"adAccountId": "act_123",
"name": "Customers",
"type": "customer_list",
"description": "Uploaded customer audience"
}
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: 'act_123',
name: 'Customers',
type: 'customer_list',
description: 'Uploaded customer audience'
})
};
fetch('https://api.kavenio.com/v1/ads/audiences', 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/audiences",
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' => 'act_123',
'name' => 'Customers',
'type' => 'customer_list',
'description' => 'Uploaded customer audience'
]),
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/audiences"
payload := strings.NewReader("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\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/audiences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"bbbbbbbbbbbbbbbb\",\n \"adAccountId\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kavenio.com/v1/ads/audiences")
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\": \"act_123\",\n \"name\": \"Customers\",\n \"type\": \"customer_list\",\n \"description\": \"Uploaded customer audience\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"audience": {
"id": "<string>",
"platformAudienceId": "<string>",
"name": "<string>",
"platform": "<string>",
"status": "<string>",
"description": "<string>",
"spec": {
"countries": [
"<string>"
],
"regions": [
{
"key": "<string>",
"name": "<string>"
}
],
"cities": [
{
"key": "<string>",
"name": "<string>",
"radius": 123
}
],
"zips": [
{
"key": "<string>",
"name": "<string>"
}
],
"metros": [
{
"key": "<string>",
"name": "<string>"
}
],
"customLocations": [
{
"latitude": 0,
"longitude": 0,
"radius": 123,
"name": "<string>",
"address": "<string>"
}
],
"excludedLocations": {},
"ageMin": 56,
"ageMax": 56,
"languages": [
"<string>"
],
"interests": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"behaviors": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"demographics": [
{
"id": "<string>",
"key": "<string>",
"name": "<string>"
}
],
"industries": [
"<string>"
],
"companySizes": [
"<string>"
],
"seniorities": [
"<string>"
],
"jobFunctions": [
"<string>"
],
"audienceInclude": [
"<string>"
],
"audienceExclude": [
"<string>"
],
"placements": {},
"specialAdCategories": [
"<string>"
]
},
"accountId": "<string>",
"adAccountId": "<string>",
"size": 0,
"createdAt": "<string>",
"updatedAt": "<string>"
},
"metaData": {},
"message": "<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
- Option 1
- Option 2
Required string length:
16Pattern:
^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]{16}$Minimum string length:
1Required string length:
1 - 255Available options:
customer_list, website, lookalike Minimum string length:
1Minimum string length:
1Required range:
1 <= x <= 540Minimum string length:
1Minimum string length:
1Required string length:
2Required range:
0.01 <= x <= 0.2Show child attributes
Show child attributes
Minimum string length:
1Required array length:
1 - 50 elementsMinimum string length:
1Minimum string length:
1Available options:
NORMAL, REACH_FREQUENCY Minimum string length:
1Minimum string length:
1Available options:
USER, COMPANY, LIST_UPLOAD Was this page helpful?
⌘I