Create Audience
curl --request POST \
--url https://api.audiencelab.io/audiences \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data @- <<EOF
{
"name": "<string>",
"filters": {
"age": {
"minAge": 25,
"maxAge": 45
},
"city": [
"<string>"
],
"state": [
"<string>"
],
"personalState": [
"<string>"
],
"zip": [
"<string>"
],
"gender": [],
"businessProfile": {
"industry": [
"<string>"
],
"seniority": [
"<string>"
],
"companyName": [
"<string>"
],
"jobTitle": [
"<string>"
],
"excludeJobTitle": [
"<string>"
]
},
"attributes": {
"education": [
"bachelor's",
"master's"
],
"excludeEducation": [
"high school"
]
}
},
"segment": [
"b2c_1253"
],
"days_back": 123
}
EOFimport requests
url = "https://api.audiencelab.io/audiences"
payload = {
"name": "<string>",
"filters": {
"age": {
"minAge": 25,
"maxAge": 45
},
"city": ["<string>"],
"state": ["<string>"],
"personalState": ["<string>"],
"zip": ["<string>"],
"gender": [],
"businessProfile": {
"industry": ["<string>"],
"seniority": ["<string>"],
"companyName": ["<string>"],
"jobTitle": ["<string>"],
"excludeJobTitle": ["<string>"]
},
"attributes": {
"education": ["bachelor's", "master's"],
"excludeEducation": ["high school"]
}
},
"segment": ["b2c_1253"],
"days_back": 123
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
filters: {
age: {minAge: 25, maxAge: 45},
city: ['<string>'],
state: ['<string>'],
personalState: ['<string>'],
zip: ['<string>'],
gender: [],
businessProfile: {
industry: ['<string>'],
seniority: ['<string>'],
companyName: ['<string>'],
jobTitle: ['<string>'],
excludeJobTitle: ['<string>']
},
attributes: {education: ['bachelor\'s', 'master\'s'], excludeEducation: ['high school']}
},
segment: ['b2c_1253'],
days_back: 123
})
};
fetch('https://api.audiencelab.io/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.audiencelab.io/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([
'name' => '<string>',
'filters' => [
'age' => [
'minAge' => 25,
'maxAge' => 45
],
'city' => [
'<string>'
],
'state' => [
'<string>'
],
'personalState' => [
'<string>'
],
'zip' => [
'<string>'
],
'gender' => [
],
'businessProfile' => [
'industry' => [
'<string>'
],
'seniority' => [
'<string>'
],
'companyName' => [
'<string>'
],
'jobTitle' => [
'<string>'
],
'excludeJobTitle' => [
'<string>'
]
],
'attributes' => [
'education' => [
'bachelor\'s',
'master\'s'
],
'excludeEducation' => [
'high school'
]
]
],
'segment' => [
'b2c_1253'
],
'days_back' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.audiencelab.io/audiences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.audiencelab.io/audiences")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.audiencelab.io/audiences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}"
response = http.request(request)
puts response.read_body{
"audienceId": "812b78c3-83e6-4d6a-8245-def0dde26223"
}{
"message": "error message"
}Audience
Create Audience
Create an audience from filters and/or segment IDs.
Segment IDs must be passed as the full exact ID with prefix in the current
taxonomy nomenclature (b2c_<number> or b2b_<number>, e.g. b2c_1253).
The legacy Delivr format (al_XXXXXX) and bare numbers are no longer supported.
POST
/
audiences
Create Audience
curl --request POST \
--url https://api.audiencelab.io/audiences \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data @- <<EOF
{
"name": "<string>",
"filters": {
"age": {
"minAge": 25,
"maxAge": 45
},
"city": [
"<string>"
],
"state": [
"<string>"
],
"personalState": [
"<string>"
],
"zip": [
"<string>"
],
"gender": [],
"businessProfile": {
"industry": [
"<string>"
],
"seniority": [
"<string>"
],
"companyName": [
"<string>"
],
"jobTitle": [
"<string>"
],
"excludeJobTitle": [
"<string>"
]
},
"attributes": {
"education": [
"bachelor's",
"master's"
],
"excludeEducation": [
"high school"
]
}
},
"segment": [
"b2c_1253"
],
"days_back": 123
}
EOFimport requests
url = "https://api.audiencelab.io/audiences"
payload = {
"name": "<string>",
"filters": {
"age": {
"minAge": 25,
"maxAge": 45
},
"city": ["<string>"],
"state": ["<string>"],
"personalState": ["<string>"],
"zip": ["<string>"],
"gender": [],
"businessProfile": {
"industry": ["<string>"],
"seniority": ["<string>"],
"companyName": ["<string>"],
"jobTitle": ["<string>"],
"excludeJobTitle": ["<string>"]
},
"attributes": {
"education": ["bachelor's", "master's"],
"excludeEducation": ["high school"]
}
},
"segment": ["b2c_1253"],
"days_back": 123
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
filters: {
age: {minAge: 25, maxAge: 45},
city: ['<string>'],
state: ['<string>'],
personalState: ['<string>'],
zip: ['<string>'],
gender: [],
businessProfile: {
industry: ['<string>'],
seniority: ['<string>'],
companyName: ['<string>'],
jobTitle: ['<string>'],
excludeJobTitle: ['<string>']
},
attributes: {education: ['bachelor\'s', 'master\'s'], excludeEducation: ['high school']}
},
segment: ['b2c_1253'],
days_back: 123
})
};
fetch('https://api.audiencelab.io/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.audiencelab.io/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([
'name' => '<string>',
'filters' => [
'age' => [
'minAge' => 25,
'maxAge' => 45
],
'city' => [
'<string>'
],
'state' => [
'<string>'
],
'personalState' => [
'<string>'
],
'zip' => [
'<string>'
],
'gender' => [
],
'businessProfile' => [
'industry' => [
'<string>'
],
'seniority' => [
'<string>'
],
'companyName' => [
'<string>'
],
'jobTitle' => [
'<string>'
],
'excludeJobTitle' => [
'<string>'
]
],
'attributes' => [
'education' => [
'bachelor\'s',
'master\'s'
],
'excludeEducation' => [
'high school'
]
]
],
'segment' => [
'b2c_1253'
],
'days_back' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.audiencelab.io/audiences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.audiencelab.io/audiences")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.audiencelab.io/audiences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"filters\": {\n \"age\": {\n \"minAge\": 25,\n \"maxAge\": 45\n },\n \"city\": [\n \"<string>\"\n ],\n \"state\": [\n \"<string>\"\n ],\n \"personalState\": [\n \"<string>\"\n ],\n \"zip\": [\n \"<string>\"\n ],\n \"gender\": [],\n \"businessProfile\": {\n \"industry\": [\n \"<string>\"\n ],\n \"seniority\": [\n \"<string>\"\n ],\n \"companyName\": [\n \"<string>\"\n ],\n \"jobTitle\": [\n \"<string>\"\n ],\n \"excludeJobTitle\": [\n \"<string>\"\n ]\n },\n \"attributes\": {\n \"education\": [\n \"bachelor's\",\n \"master's\"\n ],\n \"excludeEducation\": [\n \"high school\"\n ]\n }\n },\n \"segment\": [\n \"b2c_1253\"\n ],\n \"days_back\": 123\n}"
response = http.request(request)
puts response.read_body{
"audienceId": "812b78c3-83e6-4d6a-8245-def0dde26223"
}{
"message": "error message"
}Authorizations
Body
application/json
Filter criteria for audience selection. All array fields must be passed as arrays even for single values.
Show child attributes
Show child attributes
Optional list of audience segment IDs. Use the full exact ID including its prefix in the current taxonomy nomenclature:
b2c_<number>— consumer (B2C) segments, e.g.b2c_1254b2b_<number>— business (B2B) segments, e.g.b2b_1042
Pass the complete ID with its prefix. Bare numbers (1253) and the legacy
Delivr format (al_XXXXXX) are not supported.
Example:
["b2c_1253"]
Response
Audience created successfully
Example:
"812b78c3-83e6-4d6a-8245-def0dde26223"
⌘I

